diff options
| author | Ma Ke <make24@iscas.ac.cn> | 2025-10-22 17:54:02 +0800 |
|---|---|---|
| committer | Andi Shyti <andi.shyti@kernel.org> | 2025-12-08 03:11:27 +0100 |
| commit | a6ee6aac66fb394b7f6e6187c73bdcd873f2d139 (patch) | |
| tree | 76d807ca7711f9d39aa889383e9c8809af503ace /drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | |
| parent | eeaaf5bc1c5b236e0445bbde6026f78d05722b3b (diff) | |
i2c: amd-mp2: fix reference leak in MP2 PCI device
In i2c_amd_probe(), amd_mp2_find_device() utilizes
driver_find_next_device() which internally calls driver_find_device()
to locate the matching device. driver_find_device() increments the
reference count of the found device by calling get_device(), but
amd_mp2_find_device() fails to call put_device() to decrement the
reference count before returning. This results in a reference count
leak of the PCI device each time i2c_amd_probe() is executed, which
may prevent the device from being properly released and cause a memory
leak.
Found by code review.
Cc: stable@vger.kernel.org
Fixes: 529766e0a011 ("i2c: Add drivers for the AMD PCIe MP2 I2C controller")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20251022095402.8846-1-make24@iscas.ac.cn
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c')
0 files changed, 0 insertions, 0 deletions
