diff mbox

dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe()

Message ID 1428704921-4487-1-git-send-email-khoroshilov@ispras.ru (mailing list archive)
State Accepted
Headers show

Commit Message

Alexey Khoroshilov April 10, 2015, 10:28 p.m. UTC
Memory allocated for pch_dma is not deallocated in case of failure
in pch_dma_probe().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/dma/pch_dma.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Vinod Koul April 17, 2015, 6:12 p.m. UTC | #1
On Sat, Apr 11, 2015 at 01:28:41AM +0300, Alexey Khoroshilov wrote:
> Memory allocated for pch_dma is not deallocated in case of failure
> in pch_dma_probe().
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
Applied, thanks
diff mbox

Patch

diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
index 35c143cb88da..b859792dde95 100644
--- a/drivers/dma/pch_dma.c
+++ b/drivers/dma/pch_dma.c
@@ -949,6 +949,7 @@  err_free_res:
 err_disable_pdev:
 	pci_disable_device(pdev);
 err_free_mem:
+	kfree(pd);
 	return err;
 }