drm/amdgpu: fix pci device refcount leak
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 17 Nov 2022 15:00:03 +0000 (23:00 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 23 Nov 2022 14:47:13 +0000 (09:47 -0500)
commitb85e285e3d6352b02947fc1b72303673dfacb0aa
tree8e895b41447d294c14ae9b3361c4e05994809356
parent96e1a88fafe6a9afd371fadc0c7de41b883aaec9
drm/amdgpu: fix pci device refcount leak

As comment of pci_get_domain_bus_and_slot() says, it returns
a pci device with refcount increment, when finish using it,
the caller must decrement the reference count by calling
pci_dev_put().

So before returning from amdgpu_device_resume|suspend_display_audio(),
pci_dev_put() is called to avoid refcount leak.

Fixes: 3f12acc8d6d4 ("drm/amdgpu: put the audio codec into suspend state before gpu reset V3")
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c