Skip to content

Commit 69777e6

Browse files
Wang LiChun-Kuang Hu
authored andcommitted
drm/mediatek: Fix PM reference leak in mtk_crtc_ddp_hw_init()
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wang Li <wangli74@huawei.com> Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent 511cf7d commit 69777e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/mediatek/mtk_drm_crtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
260260
drm_connector_list_iter_end(&conn_iter);
261261
}
262262

263-
ret = pm_runtime_get_sync(crtc->dev->dev);
263+
ret = pm_runtime_resume_and_get(crtc->dev->dev);
264264
if (ret < 0) {
265265
DRM_ERROR("Failed to enable power domain: %d\n", ret);
266266
return ret;

0 commit comments

Comments
 (0)