Skip to content

Commit 13cf394

Browse files
lokeshvutlaherbertx
authored andcommitted
crypto: omap-sham - Add the offset of sg page to vaddr
kmap_atomic() gives only the page address of the input page. Driver should take care of adding the offset of the scatterlist within the page to the returned page address. omap-sham driver is not adding the offset to page and directly operates on the return vale of kmap_atomic(), because of which the following error comes when running crypto tests: 00000000: d9 a1 1b 7c aa 90 3b aa 11 ab cb 25 00 b8 ac bf [ 2.338169] 00000010: c1 39 cd ff 48 d0 a8 e2 2b fa 33 a1 [ 2.344008] alg: hash: Chunking test 1 failed for omap-sha256 So adding the scatterlist offset to vaddr. Signed-off-by: Lokesh Vutla <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 64a31be commit 13cf394

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/crypto/omap-sham.c

+1
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ static size_t omap_sham_append_sg(struct omap_sham_reqctx *ctx)
640640

641641
while (ctx->sg) {
642642
vaddr = kmap_atomic(sg_page(ctx->sg));
643+
vaddr += ctx->sg->offset;
643644

644645
count = omap_sham_append_buffer(ctx,
645646
vaddr + ctx->offset,

0 commit comments

Comments
 (0)