Patch "drm/msm/a6xx: Fix refcount leak in a6xx_gpu_init" 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/a6xx: Fix refcount leak in a6xx_gpu_init

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-a6xx-fix-refcount-leak-in-a6xx_gpu_init.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 2cba40b266e96ef2c2430e982d68f563953d1484
Author: Miaoqian Lin <linmq006@xxxxxxxxx>
Date:   Thu May 12 16:19:50 2022 +0400

    drm/msm/a6xx: Fix refcount leak in a6xx_gpu_init
    
    [ Upstream commit c56de483093d7ad0782327f95dda7da97bc4c315 ]
    
    of_parse_phandle() returns a node pointer with refcount
    incremented, we should use of_node_put() on it when not need anymore.
    
    a6xx_gmu_init() passes the node to of_find_device_by_node()
    and of_dma_configure(), of_find_device_by_node() will takes its
    reference, of_dma_configure() doesn't need the node after usage.
    
    Add missing of_node_put() to avoid refcount leak.
    
    Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support")
    Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx>
    Reviewed-by: Akhil P Oommen <quic_akhilpo@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220512121955.56937-1-linmq006@xxxxxxxxx
    Signed-off-by: Rob Clark <robdclark@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index ccc4fcf7a630..a8f6d73197b1 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1919,6 +1919,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
 	BUG_ON(!node);
 
 	ret = a6xx_gmu_init(a6xx_gpu, node);
+	of_node_put(node);
 	if (ret) {
 		a6xx_destroy(&(a6xx_gpu->base.base));
 		return ERR_PTR(ret);



[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