diff options
author | Yu Kuai <yukuai3@huawei.com> | 2020-09-09 16:49:42 +0800 |
---|---|---|
committer | Chun-Kuang Hu <chunkuang.hu@kernel.org> | 2020-09-17 06:58:01 +0800 |
commit | 64c194c00789889b0f9454f583712f079ba414ee (patch) | |
tree | 95d707133bd37eb86c5bedf346f60751442778e9 /drivers | |
parent | d494c257271153633a05c11e6dec85ddfc7700ee (diff) |
drm/mediatek: Add exception handing in mtk_drm_probe() if component init 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: 119f5173628a ("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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index a34fd805ce6d..215f3f7979e0 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -543,8 +543,13 @@ err_pm: 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; } |