devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: dma.c: fix memory leakage
@ 2013-01-19 13:06 Cong Ding
  2013-01-20 22:24 ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Cong Ding @ 2013-01-19 13:06 UTC (permalink / raw)
  To: Grant Likely, Rob Herring, devicetree-discuss, linux-kernel; +Cc: Cong Ding

The memory allocated to ofdma might be a leakage when error occurs.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
 drivers/of/dma.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/of/dma.c b/drivers/of/dma.c
index 59631b2..583e50e3 100644
--- a/drivers/of/dma.c
+++ b/drivers/of/dma.c
@@ -107,6 +107,7 @@ int of_dma_controller_register(struct device_node *np,
 	if (!nbcells) {
 		pr_err("%s: #dma-cells property is missing or invalid\n",
 		       __func__);
+		kfree(ofdma);
 		return -EINVAL;
 	}
 
-- 
1.7.10.4

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

end of thread, other threads:[~2013-02-14 13:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-19 13:06 [PATCH] of: dma.c: fix memory leakage Cong Ding
2013-01-20 22:24 ` Rob Herring
2013-01-22 10:10   ` Cong Ding
2013-02-12 17:40     ` Vinod Koul
2013-02-13 11:26       ` Cong Ding
2013-02-14  4:42         ` Vinod Koul
2013-02-14 10:16       ` [PATCH v2] dma: of-dma.c: " Cong Ding
     [not found]         ` <20130214101610.GA29017-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-14 13:42           ` Vinod Koul

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).