summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/atmel-aes.c
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2015-01-20 08:15:52 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2015-01-26 01:34:21 +0100
commit088f628cc0898c4f0da7e91945f9f43a0b18a3bf (patch)
tree6c5b921c803eb936740f2221e5bfb173ea51815b /drivers/crypto/atmel-aes.c
parentcrypto: doc - remove colons in comments (diff)
downloadlinux-088f628cc0898c4f0da7e91945f9f43a0b18a3bf.tar.xz
linux-088f628cc0898c4f0da7e91945f9f43a0b18a3bf.zip
crypto: atmel - Free memory in error path
If only one of the 2 __get_free_pages fails, then there is a memory leak. Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-aes.c')
-rw-r--r--drivers/crypto/atmel-aes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 53d1c330f8a8..6597aac9905d 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -673,9 +673,9 @@ err_map_out:
dma_unmap_single(dd->dev, dd->dma_addr_in, dd->buflen,
DMA_TO_DEVICE);
err_map_in:
+err_alloc:
free_page((unsigned long)dd->buf_out);
free_page((unsigned long)dd->buf_in);
-err_alloc:
if (err)
pr_err("error: %d\n", err);
return err;