]> Git Repo - linux.git/commitdiff
drm/mediatek: Fix child node refcount handling in early exit
authorJavier Carrasco <[email protected]>
Fri, 11 Oct 2024 19:21:51 +0000 (21:21 +0200)
committerChun-Kuang Hu <[email protected]>
Mon, 4 Nov 2024 12:20:29 +0000 (12:20 +0000)
Early exits (goto, break, return) from for_each_child_of_node() required
an explicit call to of_node_put(), which was not introduced with the
break if cnt == MAX_CRTC.

Add the missing of_node_put() before the break.

Cc: [email protected]
Fixes: d761b9450e31 ("drm/mediatek: Add cnt checking for coverity issue")
Signed-off-by: Javier Carrasco <[email protected]>
Reviewed-by: CK Hu <[email protected]>
Reviewed-by: Chen-Yu Tsai <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/
Signed-off-by: Chun-Kuang Hu <[email protected]>
drivers/gpu/drm/mediatek/mtk_drm_drv.c

index 6cff020a1bf80bbe2b232ed728a05b1b4ced8ba0..d7fc4f66b1c47c733f55d96c7687bb938141bf37 100644 (file)
@@ -406,8 +406,10 @@ static bool mtk_drm_get_all_drm_priv(struct device *dev)
                if (temp_drm_priv->mtk_drm_bound)
                        cnt++;
 
-               if (cnt == MAX_CRTC)
+               if (cnt == MAX_CRTC) {
+                       of_node_put(node);
                        break;
+               }
        }
 
        if (drm_priv->data->mmsys_dev_num == cnt) {
This page took 0.05683 seconds and 4 git commands to generate.