Skip to content

Commit

Permalink
crypto: omap-sham - fix memleak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bin Liu authored and Herbert Xu committed Apr 28, 2018
1 parent ee1b23d commit 9dbc8a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/omap-sham.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ static void omap_sham_finish_req(struct ahash_request *req, int err)

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

if (test_bit(FLAGS_SGS_ALLOCED, &dd->flags))
kfree(ctx->sg);
Expand Down

0 comments on commit 9dbc8a0

Please sign in to comment.