Skip to content

Commit

Permalink
crypto: omap-sham - fix memleak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bin Liu authored and Greg Kroah-Hartman committed Jun 16, 2018
1 parent ef2aa9f commit 20f4d77
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 @@ -1081,7 +1081,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 20f4d77

Please sign in to comment.