Patch "drm: msm: fix possible memory leak in mdp5_crtc_cursor_set()" has been added to the 5.18-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm: msm: fix possible memory leak in mdp5_crtc_cursor_set()

to the 5.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-msm-fix-possible-memory-leak-in-mdp5_crtc_cursor.patch
and it can be found in the queue-5.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3ea9a115e57f7a80f0395c5d33ac3ceebe329569
Author: Hangyu Hua <hbh25y@xxxxxxxxx>
Date:   Mon May 9 14:11:25 2022 +0800

    drm: msm: fix possible memory leak in mdp5_crtc_cursor_set()
    
    [ Upstream commit 947a844bb3ebff0f4736d244d792ce129f6700d7 ]
    
    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: e172d10a9c4a ("drm/msm/mdp5: Add hardware cursor support")
    Signed-off-by: Hangyu Hua <hbh25y@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220509061125.18585-1-hbh25y@xxxxxxxxx
    Signed-off-by: Rob Clark <robdclark@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
index fe2922c8d21b..31447da0af25 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
@@ -997,8 +997,10 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
 
 	ret = msm_gem_get_and_pin_iova(cursor_bo, kms->aspace,
 			&mdp5_crtc->cursor.iova);
-	if (ret)
+	if (ret) {
+		drm_gem_object_put(cursor_bo);
 		return -EINVAL;
+	}
 
 	pm_runtime_get_sync(&pdev->dev);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux