lkml.org 
[lkml]   [2015]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 2/8] misc: sram: fix device node reference leak on error
Date
A pointer device node reference should be decremented on manual exit
from for_each_available_child_of_node() loop.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
drivers/misc/sram.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 76a23f9..0bfdfac 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -112,6 +112,7 @@ static int sram_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"could not get address for node %s\n",
child->full_name);
+ of_node_put(child);
goto err_chunks;
}

@@ -120,6 +121,7 @@ static int sram_probe(struct platform_device *pdev)
"reserved block %s outside the sram area\n",
child->full_name);
ret = -EINVAL;
+ of_node_put(child);
goto err_chunks;
}

--
2.1.4


\
 
 \ /
  Last update: 2015-05-25 14:41    [W:0.040 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site