Commit 99e5a8df authored by wen yang's avatar wen yang Committed by Kevin Hilman

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: default avatarWen Yang <yellowriver2010@hotmail.com>
Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Fixes: d4983983 ("soc: amlogic: add meson-canvas driver")
Signed-off-by: default avatarKevin Hilman <khilman@baylibre.com>
parent bfeffd15
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment