diff options
| author | Jiang Liu <liuj97@gmail.com> | 2012-09-13 12:21:59 -0400 |
|---|---|---|
| committer | Matthew Garrett <mjg@redhat.com> | 2012-09-13 16:46:31 -0400 |
| commit | f661848b74b33069b0b7068c414bd282c407781d (patch) | |
| tree | d2bd585236e7e2ada255c5c1d99dc422d833653a | |
| parent | 3f5449bf39896587ca9f87b76832c5aa30f0f5c7 (diff) | |
eeepc-laptop: fix device reference count leakage in eeepc_rfkill_hotplug()
Fix a device reference count leakage issue in function
eeepc_rfkill_hotplug().
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
| -rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index dab91b48d22c..5ca264179f4e 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
| @@ -610,12 +610,12 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) | |||
| 610 | 610 | ||
| 611 | if (!bus) { | 611 | if (!bus) { |
| 612 | pr_warn("Unable to find PCI bus 1?\n"); | 612 | pr_warn("Unable to find PCI bus 1?\n"); |
| 613 | goto out_unlock; | 613 | goto out_put_dev; |
| 614 | } | 614 | } |
| 615 | 615 | ||
| 616 | if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) { | 616 | if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) { |
| 617 | pr_err("Unable to read PCI config space?\n"); | 617 | pr_err("Unable to read PCI config space?\n"); |
| 618 | goto out_unlock; | 618 | goto out_put_dev; |
| 619 | } | 619 | } |
| 620 | 620 | ||
| 621 | absent = (l == 0xffffffff); | 621 | absent = (l == 0xffffffff); |
| @@ -627,7 +627,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) | |||
| 627 | absent ? "absent" : "present"); | 627 | absent ? "absent" : "present"); |
| 628 | pr_warn("skipped wireless hotplug as probably " | 628 | pr_warn("skipped wireless hotplug as probably " |
| 629 | "inappropriate for this model\n"); | 629 | "inappropriate for this model\n"); |
| 630 | goto out_unlock; | 630 | goto out_put_dev; |
| 631 | } | 631 | } |
| 632 | 632 | ||
| 633 | if (!blocked) { | 633 | if (!blocked) { |
| @@ -635,7 +635,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) | |||
| 635 | if (dev) { | 635 | if (dev) { |
| 636 | /* Device already present */ | 636 | /* Device already present */ |
| 637 | pci_dev_put(dev); | 637 | pci_dev_put(dev); |
| 638 | goto out_unlock; | 638 | goto out_put_dev; |
| 639 | } | 639 | } |
| 640 | dev = pci_scan_single_device(bus, 0); | 640 | dev = pci_scan_single_device(bus, 0); |
| 641 | if (dev) { | 641 | if (dev) { |
| @@ -650,6 +650,8 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) | |||
| 650 | pci_dev_put(dev); | 650 | pci_dev_put(dev); |
| 651 | } | 651 | } |
| 652 | } | 652 | } |
| 653 | out_put_dev: | ||
| 654 | pci_dev_put(port); | ||
| 653 | } | 655 | } |
| 654 | 656 | ||
| 655 | out_unlock: | 657 | out_unlock: |
