drm/imx/dcss: Add missing of_node_put() in fail path
Subsystems (4)
PATCH v2 1/1 drm/imx/dcss: Add missing of_node_put() in fail path
In dcss_dev_create() and dcss_dev_destroy(), we should call of_node_put() in fail path or before the dcss's destroy as of_graph_get_port_by_id() has increased the refcount.
---
changelog:
v2: add of_node_put() in dcss_dev_destroy() advised by Laurentiu
v1: only fix bug in dcss_dev_create().
v1 link: https://lore.kernel.org/all/[email protected]/
drivers/gpu/drm/imx/dcss/dcss-dev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/imx/dcss/dcss-dev.c +3 -0
@@ -207,6 +207,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output) ret =dcss_submodules_init (dcss);if (ret) { +of_node_put (dcss->of_port);dev_err (dev,"submodules initialization failed\n" ); goto clks_err; }
@@ -237,6 +238,8 @@ void dcss_dev_destroy(struct dcss_dev *dcss)dcss_clocks_disable (dcss); } +of_node_put (dcss->of_port); +pm_runtime_disable (dcss->dev);dcss_submodules_stop (dcss);
Signature · 1 line
2.25.1
Hi,
Quoted 6 lines · Liang He
In
dcss_dev_create()anddcss_dev_destroy(), we should callof_node_put()in fail path or before the dcss's destroy asof_graph_get_port_by_id()has increased the refcount.Fixes 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")Signed-off-by Liang He <[email protected]>
Applied to drm-misc-fixes.
Thanks,
Laurentiu
Quoted 36 lines
---
changelog:v2: add
of_node_put()indcss_dev_destroy()advised by Laurentiu
v1: only fix bug indcss_dev_create().v1 link: https://lore.kernel.org/all/[email protected]/
drivers/gpu/drm/imx/dcss/dcss-dev.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/imx/dcss/dcss-dev.c +3
-0@@ -207,6 +207,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output) ret =dcss_submodules_init (dcss);if (ret) { +of_node_put (dcss->of_port);dev_err (dev,"submodules initialization failed\n" ); goto clks_err; }@@ -237,6 +238,8 @@ void dcss_dev_destroy(struct dcss_dev *dcss)dcss_clocks_disable (dcss); } +of_node_put (dcss->of_port); +pm_runtime_disable (dcss->dev);dcss_submodules_stop (dcss);Signature · 1 line
2.25.1