mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
misc: sram: fix device node reference leak on error
A pointer device node reference should be decremented on manual exit from for_each_available_child_of_node() loop. Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
ee895ccdf7
commit
b13365bbec
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue