Skip to content

Commit

Permalink
misc: sram: fix device node reference leak on error
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Vladimir Zapolskiy authored and Greg Kroah-Hartman committed Jun 13, 2015
1 parent ee895cc commit b13365b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/misc/sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit b13365b

Please sign in to comment.