Skip to content

Commit fd008d1

Browse files
committed
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu: "This fixes a bug in the implementation of xcbc and cmac in caam" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: caam - fix copy of next buffer for xcbc and cmac
2 parents fcf8891 + b4e9e93 commit fd008d1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/crypto/caam/caamhash.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -865,19 +865,18 @@ static int ahash_update_ctx(struct ahash_request *req)
865865
if (ret)
866866
goto unmap_ctx;
867867

868-
if (mapped_nents) {
868+
if (mapped_nents)
869869
sg_to_sec4_sg_last(req->src, mapped_nents,
870870
edesc->sec4_sg + sec4_sg_src_index,
871871
0);
872-
if (*next_buflen)
873-
scatterwalk_map_and_copy(next_buf, req->src,
874-
to_hash - *buflen,
875-
*next_buflen, 0);
876-
} else {
872+
else
877873
sg_to_sec4_set_last(edesc->sec4_sg + sec4_sg_src_index -
878874
1);
879-
}
880875

876+
if (*next_buflen)
877+
scatterwalk_map_and_copy(next_buf, req->src,
878+
to_hash - *buflen,
879+
*next_buflen, 0);
881880
desc = edesc->hw_desc;
882881

883882
edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg,

0 commit comments

Comments
 (0)