Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Signed-off-by: Liang He <windhl@126.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220714081337.374761-1-windhl@126.com

authored by

Liang He and committed by
Laurentiu Palcu
02c87df2 ef2084a8

+3
+3
drivers/gpu/drm/imx/dcss/dcss-dev.c
··· 207 207 208 208 ret = dcss_submodules_init(dcss); 209 209 if (ret) { 210 + of_node_put(dcss->of_port); 210 211 dev_err(dev, "submodules initialization failed\n"); 211 212 goto clks_err; 212 213 } ··· 237 236 dcss_ctxld_suspend(dcss->ctxld); 238 237 dcss_clocks_disable(dcss); 239 238 } 239 + 240 + of_node_put(dcss->of_port); 240 241 241 242 pm_runtime_disable(dcss->dev); 242 243