Skip to content

Commit 20f4d77

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 ef2aa9f commit 20f4d77

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

10821082
if (test_bit(FLAGS_SGS_COPIED, &dd->flags))
10831083
free_pages((unsigned long)sg_virt(ctx->sg),
1084-
get_order(ctx->sg->length));
1084+
get_order(ctx->sg->length + ctx->bufcnt));
10851085

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

0 commit comments

Comments
 (0)