Commit 02c87df2 authored by Liang He's avatar Liang He Committed by Laurentiu Palcu

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.

Fixes: 9021c317 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Signed-off-by: default avatarLiang He <windhl@126.com>
Reviewed-by: default avatarLaurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: default avatarLaurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220714081337.374761-1-windhl@126.com
parent ef2084a8
...@@ -207,6 +207,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output) ...@@ -207,6 +207,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
ret = dcss_submodules_init(dcss); ret = dcss_submodules_init(dcss);
if (ret) { if (ret) {
of_node_put(dcss->of_port);
dev_err(dev, "submodules initialization failed\n"); dev_err(dev, "submodules initialization failed\n");
goto clks_err; goto clks_err;
} }
...@@ -237,6 +238,8 @@ void dcss_dev_destroy(struct dcss_dev *dcss) ...@@ -237,6 +238,8 @@ void dcss_dev_destroy(struct dcss_dev *dcss)
dcss_clocks_disable(dcss); dcss_clocks_disable(dcss);
} }
of_node_put(dcss->of_port);
pm_runtime_disable(dcss->dev); pm_runtime_disable(dcss->dev);
dcss_submodules_stop(dcss); dcss_submodules_stop(dcss);
......
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