Skip to content

Commit

Permalink
soc: amlogic: canvas: add missing put_device() call in meson_canvas_g…
Browse files Browse the repository at this point in the history
…et()

if of_find_device_by_node() succeed, meson_canvas_get() doesn't have
a corresponding put_device(). Thus add put_device() to fix the exception
handling for this function implementation.

Fixes: 382f8be ("soc: amlogic: canvas: Fix meson_canvas_get when probe failed")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Link: https://lore.kernel.org/r/20201117011322.522477-1-yukuai3@huawei.com
  • Loading branch information
Yu Kuai authored and Kevin Hilman committed Dec 1, 2020
1 parent 4a434ab commit 28f851e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/soc/amlogic/meson-canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ struct meson_canvas *meson_canvas_get(struct device *dev)
* current state, this driver probe cannot return -EPROBE_DEFER
*/
canvas = dev_get_drvdata(&canvas_pdev->dev);
if (!canvas)
if (!canvas) {
put_device(&canvas_pdev->dev);
return ERR_PTR(-EINVAL);
}

return canvas;
}
Expand Down

0 comments on commit 28f851e

Please sign in to comment.