linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.19] dmaengine: at_hdmac: Fix memory leak
@ 2020-09-20  8:28 Pavel Machek
  2020-09-23  6:39 ` Ludovic Desroches
  2020-09-23  8:13 ` Tudor.Ambarus
  0 siblings, 2 replies; 7+ messages in thread
From: Pavel Machek @ 2020-09-20  8:28 UTC (permalink / raw)
  To: linux-kernel, dmaengine, linux-arm-kernel, dan.j.williams, vkoul,
	ludovic.desroches, stable, Greg KH


[-- Attachment #1.1: Type: text/plain, Size: 793 bytes --]


This fixes memory leak in at_hdmac. Mainline does not have the same
problem.

Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 86427f6ba78c..0847b2055857 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1714,8 +1714,10 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
 	atslave->dma_dev = &dmac_pdev->dev;
 
 	chan = dma_request_channel(mask, at_dma_filter, atslave);
-	if (!chan)
+	if (!chan) {
+		kfree(atslave);
 		return NULL;
+	}
 
 	atchan = to_at_dma_chan(chan);
 	atchan->per_if = dma_spec->args[0] & 0xff;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-06 16:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-20  8:28 [PATCH 4.19] dmaengine: at_hdmac: Fix memory leak Pavel Machek
2020-09-23  6:39 ` Ludovic Desroches
2020-09-23  8:13 ` Tudor.Ambarus
2020-09-23  8:19   ` Tudor.Ambarus
2021-01-04 11:02     ` Greg KH
2021-01-05  8:03       ` Tudor.Ambarus
2021-01-06 16:53         ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).