Skip to content

Commit 87883c8

Browse files
liubiingregkh
authored andcommitted
crypto: omap-sham - fix memleak
commit 9dbc8a0 upstream. Fixes: 8043bb1 ("crypto: omap-sham - convert driver logic to use sgs for data xmit") The memory pages freed in omap_sham_finish_req() were less than those allocated in omap_sham_copy_sgs(). Cc: stable@vger.kernel.org Signed-off-by: Bin Liu <b-liu@ti.com> Acked-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent efc67e7 commit 87883c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/crypto/omap-sham.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ static void omap_sham_finish_req(struct ahash_request *req, int err)
10821082

10831083
if (test_bit(FLAGS_SGS_COPIED, &dd->flags))
10841084
free_pages((unsigned long)sg_virt(ctx->sg),
1085-
get_order(ctx->sg->length));
1085+
get_order(ctx->sg->length + ctx->bufcnt));
10861086

10871087
if (test_bit(FLAGS_SGS_ALLOCED, &dd->flags))
10881088
kfree(ctx->sg);

0 commit comments

Comments
 (0)