]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/sysfb: ofdrm: fix PCI device reference leaks
authorYuho Choi <dbgh9129@gmail.com>
Mon, 20 Apr 2026 00:25:13 +0000 (20:25 -0400)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 27 Apr 2026 09:30:49 +0000 (11:30 +0200)
commit4aa8110000b0d215deef8eed283565dd0c1def88
tree0b60f50ecec312adf4df37a0b28b4be6c52e8cde
parent3d4c2268bd7243c3780fe32bf24ff876da272acf
drm/sysfb: ofdrm: fix PCI device reference leaks

display_get_pci_dev_of() gets a referenced PCI device via
pci_get_device(). Drop that reference when pci_enable_device() fails and
release it during the managed teardown path after pci_disable_device().

Without that, ofdrm leaks the pci_dev reference on both the error path
and the normal cleanup path.

Fixes: c8a17756c425 ("drm/ofdrm: Add ofdrm for Open Firmware framebuffers")
Co-developed-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Co-developed-by: Taegyu Kim <tmk5904@psu.edu>
Signed-off-by: Taegyu Kim <tmk5904@psu.edu>
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260420002513.216-1-dbgh9129@gmail.com
drivers/gpu/drm/sysfb/ofdrm.c