Skip to content

Commit

Permalink
drm/mediatek: Add exception handing in mtk_drm_probe() if component i…
Browse files Browse the repository at this point in the history
…nit fail

mtk_ddp_comp_init() is called in a loop in mtk_drm_probe(), if it
fail, previous successive init component is not proccessed.

Thus uninitialize valid component and put their device if component
init failed.

Fixes: 119f517 ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
  • Loading branch information
YuKuai-huawei authored and Chun-Kuang Hu committed Sep 16, 2020
1 parent d494c25 commit 64c194c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/gpu/drm/mediatek/mtk_drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,13 @@ static int mtk_drm_probe(struct platform_device *pdev)
pm_runtime_disable(dev);
err_node:
of_node_put(private->mutex_node);
for (i = 0; i < DDP_COMPONENT_ID_MAX; i++)
for (i = 0; i < DDP_COMPONENT_ID_MAX; i++) {
of_node_put(private->comp_node[i]);
if (private->ddp_comp[i]) {
put_device(private->ddp_comp[i]->larb_dev);
private->ddp_comp[i] = NULL;
}
}
return ret;
}

Expand Down

0 comments on commit 64c194c

Please sign in to comment.