diff options
author | Bin Liu <b-liu@ti.com> | 2018-04-17 21:53:13 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-04-28 10:09:35 +0200 |
commit | 9dbc8a0328efa485a6f5b68b867f9f523a3fbeff (patch) | |
tree | 650d21c56570777740142e61d2b48e1f529e6892 /drivers/crypto | |
parent | crypto: drivers - Remove depends on HAS_DMA in case of platform dependency (diff) | |
download | linux-9dbc8a0328efa485a6f5b68b867f9f523a3fbeff.tar.xz linux-9dbc8a0328efa485a6f5b68b867f9f523a3fbeff.zip |
crypto: omap-sham - fix memleak
Fixes: 8043bb1ae03cb ("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>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/omap-sham.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index ad02aa63b519..d1a1c74fb56a 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -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); |