Skip to content

Commit

Permalink
eeepc-laptop: fix device reference count leakage in eeepc_rfkill_hotp…
Browse files Browse the repository at this point in the history
…lug()

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>
  • Loading branch information
Jiang Liu authored and Matthew Garrett committed Sep 13, 2012
1 parent 3f5449b commit f661848
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,12 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)

if (!bus) {
pr_warn("Unable to find PCI bus 1?\n");
goto out_unlock;
goto out_put_dev;
}

if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) {
pr_err("Unable to read PCI config space?\n");
goto out_unlock;
goto out_put_dev;
}

absent = (l == 0xffffffff);
Expand All @@ -627,15 +627,15 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
absent ? "absent" : "present");
pr_warn("skipped wireless hotplug as probably "
"inappropriate for this model\n");
goto out_unlock;
goto out_put_dev;
}

if (!blocked) {
dev = pci_get_slot(bus, 0);
if (dev) {
/* Device already present */
pci_dev_put(dev);
goto out_unlock;
goto out_put_dev;
}
dev = pci_scan_single_device(bus, 0);
if (dev) {
Expand All @@ -650,6 +650,8 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
pci_dev_put(dev);
}
}
out_put_dev:
pci_dev_put(port);
}

out_unlock:
Expand Down

0 comments on commit f661848

Please sign in to comment.