Skip to content

Commit f708e8b

Browse files
javiercarrascocruzChun-Kuang Hu
authored andcommitted
drm/mediatek: Fix child node refcount handling in early exit
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: d761b94 ("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]>
1 parent 4c93284 commit f708e8b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/mediatek/mtk_drm_drv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,10 @@ static bool mtk_drm_get_all_drm_priv(struct device *dev)
406406
if (temp_drm_priv->mtk_drm_bound)
407407
cnt++;
408408

409-
if (cnt == MAX_CRTC)
409+
if (cnt == MAX_CRTC) {
410+
of_node_put(node);
410411
break;
412+
}
411413
}
412414

413415
if (drm_priv->data->mmsys_dev_num == cnt) {

0 commit comments

Comments
 (0)