acpi_video: fix leaking PCI references
authorAlan Cox <alan@linux.intel.com>
Wed, 25 Apr 2012 13:33:33 +0000 (14:33 +0100)
committerLen Brown <len.brown@intel.com>
Fri, 1 Jun 2012 17:40:55 +0000 (13:40 -0400)
Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/video.c

index 9577b6fa26507cad1db1f2ddf7d6f114abfdf513..66e8f7333e9b2d8a81ac2ded5e14bff9f9b7bb6b 100644 (file)
@@ -1745,6 +1745,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
 
 static int __init intel_opregion_present(void)
 {
+       int i915 = 0;
 #if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE)
        struct pci_dev *dev = NULL;
        u32 address;
@@ -1757,10 +1758,10 @@ static int __init intel_opregion_present(void)
                pci_read_config_dword(dev, 0xfc, &address);
                if (!address)
                        continue;
-               return 1;
+               i915 = 1;
        }
 #endif
-       return 0;
+       return i915;
 }
 
 int acpi_video_register(void)