crypto: ccree - fix free of unallocated mlli buffer
authorHadar Gat <hadar.gat@arm.com>
Tue, 15 Jan 2019 13:43:13 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:40 +0000 (20:09 +0100)
commit009eeb9878b480cec08ade74e94e21e04cc45a24
treefc48f57bbe8cc896db24c1bafb6d4039ff5e324d
parent6f4c11b09770e06781acee7873fe24c345c38a2e
crypto: ccree - fix free of unallocated mlli buffer

commit a49411959ea6d4915a9fd2a7eb5ba220e6284e9a upstream.

In cc_unmap_aead_request(), call dma_pool_free() for mlli buffer only
if an item is allocated from the pool and not always if there is a
pool allocated.
This fixes a kernel panic when trying to free a non-allocated item.

Cc: stable@vger.kernel.org
Signed-off-by: Hadar Gat <hadar.gat@arm.com>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccree/cc_buffer_mgr.c