summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-04-25 14:33:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-17 11:23:11 -0700
commitae797dcdae86481103b6ed79d97ac09e57e2feef (patch)
treeaf49746efd19791b1ca89afbac410b63550cf834
parent18f63bf60d507b4588f33ecfd8657f5d5e2a7b45 (diff)
downloadlwn-ae797dcdae86481103b6ed79d97ac09e57e2feef.tar.gz
lwn-ae797dcdae86481103b6ed79d97ac09e57e2feef.zip
acpi_video: fix leaking PCI references
commit cfb46f433a4da97c31780e08a259fac2cb6bd61f upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/acpi/video.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index db39e9e607d8..623a3357ce9b 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1732,6 +1732,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;
@@ -1744,10 +1745,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)