From 088f628cc0898c4f0da7e91945f9f43a0b18a3bf Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Tue, 20 Jan 2015 08:15:52 +0100 Subject: 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 Signed-off-by: Herbert Xu --- drivers/crypto/atmel-aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/crypto/atmel-aes.c') diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 53d1c330f8a..6597aac9905 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; -- cgit v1.2.3-70-g09d2