crypto: caam - fix missing dma unmap on error path
authorCristian Stoica <cristian.stoica@freescale.com>
Thu, 30 Oct 2014 12:40:22 +0000 (14:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:23:00 +0000 (09:23 -0800)
commit77204ef5865a366573b4ee87c74daf6361039b96
tree8eb95710d7b7a413ffb2efb967eb65e5729284a2
parent340eb9b208105e5c86b936d7f8b8d8e865f1bc6f
crypto: caam - fix missing dma unmap on error path

commit 738459e3f88538f2ece263424dafe5d91799e46b upstream.

If dma mapping for dma_addr_out fails, the descriptor memory is freed
but the previous dma mapping for dma_addr_in remains.
This patch resolves the missing dma unmap and groups resource
allocations at function start.

Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/caam/key_gen.c