soc: amlogic: add missing of_node_put()

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: d4983983d9 ("soc: amlogic: add meson-canvas driver")
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
This commit is contained in:
wen yang 2019-02-05 05:07:26 +00:00 committed by Kevin Hilman
parent bfeffd1552
commit 99e5a8df8b

View File

@ -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);