mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 21:45:45 +02:00
drm: msm: fix possible memory leak in mdp5_crtc_cursor_set()
[ Upstream commit947a844bb3] drm_gem_object_lookup will call drm_gem_object_get inside. So cursor_bo needs to be put when msm_gem_get_and_pin_iova fails. Fixes:e172d10a9c("drm/msm/mdp5: Add hardware cursor support") Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Link: https://lore.kernel.org/r/20220509061125.18585-1-hbh25y@gmail.com Signed-off-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
48e82ce8cd
commit
656aa3c51f
|
|
@ -983,8 +983,10 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
|
||||||
|
|
||||||
ret = msm_gem_get_and_pin_iova(cursor_bo, kms->aspace,
|
ret = msm_gem_get_and_pin_iova(cursor_bo, kms->aspace,
|
||||||
&mdp5_crtc->cursor.iova);
|
&mdp5_crtc->cursor.iova);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
drm_gem_object_put(cursor_bo);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
pm_runtime_get_sync(&pdev->dev);
|
pm_runtime_get_sync(&pdev->dev);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user