summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_slot.c
diff options
context:
space:
mode:
authorAlex Chiang2008-07-17 19:13:32 +0200
committerJesse Barnes2008-07-22 20:18:17 +0200
commite4268aad42e9f37d01925022830b16bab3d0d5af (patch)
tree343b114454c8a82cf3d6eb83d601253d63b6d33c /drivers/acpi/pci_slot.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 (diff)
downloadkernel-qcow2-linux-e4268aad42e9f37d01925022830b16bab3d0d5af.tar.gz
kernel-qcow2-linux-e4268aad42e9f37d01925022830b16bab3d0d5af.tar.xz
kernel-qcow2-linux-e4268aad42e9f37d01925022830b16bab3d0d5af.zip
PCI hotplug: fix error path in pci_slot's register_slot
Juha Leppnen noticed that an error path in register_slot() wasn't returning appropriately, leading to a condition where we might access a kfree'ed pointer, so let's fix that. Additionally, fix up the copyright information in the file while we're in there. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/acpi/pci_slot.c')
-rw-r--r--drivers/acpi/pci_slot.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
index b9ab030a52d5..dd376f7ad090 100644
--- a/drivers/acpi/pci_slot.c
+++ b/drivers/acpi/pci_slot.c
@@ -6,8 +6,8 @@
* Thanks to Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> for code
* review and fixes.
*
- * Copyright (C) 2007 Alex Chiang <achiang@hp.com>
- * Copyright (C) 2007 Hewlett-Packard Development Company, L.P.
+ * Copyright (C) 2007-2008 Hewlett-Packard Development Company, L.P.
+ * Alex Chiang <achiang@hp.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -158,6 +158,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
if (IS_ERR(pci_slot)) {
err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot));
kfree(slot);
+ return AE_OK;
}
slot->root_handle = parent_context->root_handle;