Skip to content

Commit a3d970f

Browse files
javiercarrascocruzgregkh
authored andcommitted
drm/mediatek: Fix child node refcount handling in early exit
commit f708e8b upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8ab73ac commit a3d970f

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
@@ -378,8 +378,10 @@ static bool mtk_drm_get_all_drm_priv(struct device *dev)
378378
if (all_drm_priv[cnt] && all_drm_priv[cnt]->mtk_drm_bound)
379379
cnt++;
380380

381-
if (cnt == MAX_CRTC)
381+
if (cnt == MAX_CRTC) {
382+
of_node_put(node);
382383
break;
384+
}
383385
}
384386

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

0 commit comments

Comments
 (0)