summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwen yang <yellowriver2010@hotmail.com>2019-02-05 05:07:26 +0000
committerKevin Hilman <khilman@baylibre.com>2019-02-06 20:03:02 -0800
commit99e5a8df8b3627239ecef09547931a81618d0851 (patch)
treec983bb28224130d6fe49e59c84a6d8e291f872a2
parentbfeffd155283772bbe78c6a05dec7c0128ee500c (diff)
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: d4983983d987 ("soc: amlogic: add meson-canvas driver") Signed-off-by: Kevin Hilman <khilman@baylibre.com>
-rw-r--r--drivers/soc/amlogic/meson-canvas.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c
index fce33ca76bb6..87a6c6e23591 100644
--- a/drivers/soc/amlogic/meson-canvas.c
+++ b/drivers/soc/amlogic/meson-canvas.c
@@ -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);