Skip to content

Commit

Permalink
soc: amlogic: add missing of_node_put()
Browse files Browse the repository at this point in the history
The call to of_parse_phandle returns a node pointer with refcount
incremented thus it must be explicitly decremented here after the last
usage.

Signed-off-by: Wen Yang <yellowriver2010@hotmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Fixes: d498398 ("soc: amlogic: add meson-canvas driver")
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
  • Loading branch information
wen yang authored and Kevin Hilman committed Feb 7, 2019
1 parent bfeffd1 commit 99e5a8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/soc/amlogic/meson-canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ struct meson_canvas *meson_canvas_get(struct device *dev)
return ERR_PTR(-ENODEV);

canvas_pdev = of_find_device_by_node(canvas_node);
if (!canvas_pdev)
if (!canvas_pdev) {
of_node_put(canvas_node);
return ERR_PTR(-EPROBE_DEFER);
}

of_node_put(canvas_node);
return dev_get_drvdata(&canvas_pdev->dev);
}
EXPORT_SYMBOL_GPL(meson_canvas_get);
Expand Down

0 comments on commit 99e5a8d

Please sign in to comment.