crypto: omap-sham - fix memleak

Fixes: 8043bb1ae0 ("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>
This commit is contained in:
Bin Liu 2018-04-17 14:53:13 -05:00 коммит произвёл Herbert Xu
Родитель ee1b23d1df
Коммит 9dbc8a0328
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1087,7 +1087,7 @@ static void omap_sham_finish_req(struct ahash_request *req, int err)
if (test_bit(FLAGS_SGS_COPIED, &dd->flags)) if (test_bit(FLAGS_SGS_COPIED, &dd->flags))
free_pages((unsigned long)sg_virt(ctx->sg), 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)) if (test_bit(FLAGS_SGS_ALLOCED, &dd->flags))
kfree(ctx->sg); kfree(ctx->sg);