Skip to content

Commit 9dbc8a0

Browse files
liubiinherbertx
authored andcommitted
crypto: omap-sham - fix memleak
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>
1 parent ee1b23d commit 9dbc8a0

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
@@ -1087,7 +1087,7 @@ static void omap_sham_finish_req(struct ahash_request *req, int err)
10871087

10881088
if (test_bit(FLAGS_SGS_COPIED, &dd->flags))
10891089
free_pages((unsigned long)sg_virt(ctx->sg),
1090-
get_order(ctx->sg->length));
1090+
get_order(ctx->sg->length + ctx->bufcnt));
10911091

10921092
if (test_bit(FLAGS_SGS_ALLOCED, &dd->flags))
10931093
kfree(ctx->sg);

0 commit comments

Comments
 (0)