Patch "drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()" has been added to the 4.19-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/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()

to the 4.19-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-amdgpu-fix-pci-device-refcount-leak-in-amdgpu_at.patch
and it can be found in the queue-4.19 subdirectory.

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



commit d025190cf5d48bcad8fe1e6ad2a8c57ef1c3655d
Author: Xiongfeng Wang <wangxiongfeng2@xxxxxxxxxx>
Date:   Tue Nov 22 19:30:43 2022 +0800

    drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()
    
    [ Upstream commit ca54639c7752edf1304d92ff4d0c049d4efc9ba0 ]
    
    As comment of pci_get_class() says, it returns a pci_device with its
    refcount increased and decreased the refcount for the input parameter
    @from if it is not NULL.
    
    If we break the loop in amdgpu_atrm_get_bios() with 'pdev' not NULL, we
    need to call pci_dev_put() to decrease the refcount. Add the missing
    pci_dev_put() to avoid refcount leak.
    
    Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
    Signed-off-by: Xiongfeng Wang <wangxiongfeng2@xxxxxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index 6cf3dd5edffd..c1e2e9912bf0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -312,6 +312,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
 
 	if (!found)
 		return false;
+	pci_dev_put(pdev);
 
 	adev->bios = kmalloc(size, GFP_KERNEL);
 	if (!adev->bios) {



[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