mbox series

[0/2] drm: Fix PCI device refcount leak

Message ID 20221122113043.18715-1-wangxiongfeng2@huawei.com (mailing list archive)
Headers show
Series drm: Fix PCI device refcount leak | expand

Message

Xiongfeng Wang Nov. 22, 2022, 11:30 a.m. UTC
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 use pci_get_class() to iterate all the PCI device of a certain
class, when we find the expected device and break the iteration loop,
the refcount of the found PCI device is increased. When finish using
the PCI device, we need to call pci_dev_put() to decrease the refcount.


Xiongfeng Wang (2):
  drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios()
  drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()

 drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1 +
 drivers/gpu/drm/radeon/radeon_bios.c     | 1 +
 2 files changed, 2 insertions(+)