Skip to contentSkip to conversation

ACPI: video: Release PCI device reference after lookup

PATCH Applied Yuho Choi 2 participants 2 messages Aug 7 ACPI

lore
Share & tools
lore

Yuho Choi

author
#0 lore raw

PATCH 1/1 ACPI: video: Release PCI device reference after lookup

video_detect_portege_r100() uses pci_get_device() only as a boolean check for the Trident CyberBlade XP4m32 device. pci_get_device() takes a reference on a matching PCI device, but the callback returns without releasing it.

Drop the reference after selecting the vendor backlight quirk so the PCI device can be released normally.

Fixes 35a341c9b25d ("ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100")
Assisted-by OpenAI-Codex:GPT-5
---
 drivers/acpi/video_detect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/acpi/video_detect.c +3 -1
index 458efa4fe9d4..4c1c3b0b5499 100644
@@ -137,8 +137,10 @@ static int video_detect_portege_r100(const struct dmi_system_id *d)
 	struct pci_dev *dev;
 	/* Search for Trident CyberBlade XP4m32 to confirm Portégé R100 */
 	dev = pci_get_device(PCI_VENDOR_ID_TRIDENT, 0x2100, NULL);
-	if (dev)
+	if (dev) {
 		acpi_backlight_dmi = acpi_backlight_vendor;
+		pci_dev_put(dev);
+	}
 	return 0;
 }
 
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 23 lines · Yuho Choi

video_detect_portege_r100() uses pci_get_device() only as a boolean check for the Trident CyberBlade XP4m32 device. pci_get_device() takes a reference on a matching PCI device, but the callback returns without releasing it.

Drop the reference after selecting the vendor backlight quirk so the PCI device can be released normally.

Fixes 35a341c9b25d ("ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100")
Assisted-by OpenAI-Codex:GPT-5
---
 drivers/acpi/video_detect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/acpi/video_detect.c +0 -0
index 458efa4fe9d4..4c1c3b0b5499 100644
@@ -137,8 +137,10 @@ static int video_detect_portege_r100(const struct dmi_system_id *d)
        struct pci_dev *dev;
        /* Search for Trident CyberBlade XP4m32 to confirm Portégé R100 */

drivers/acpi/video_detect.c static int video_detect_portege_r100(const struct dmi_system_id *d)

Quoted 10 lines
drivers/acpi/video_detect.c +3 -2
        dev = pci_get_device(PCI_VENDOR_ID_TRIDENT, 0x2100, NULL);
-       if (dev)
+       if (dev) {
                acpi_backlight_dmi = acpi_backlight_vendor;
+               pci_dev_put(dev);
+       }
        return 0;
 }
 
--

Applied as 7.3 material, thanks!