diff options
author | Alex Chiang <achiang@hp.com> | 2008-07-17 13:13:32 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-07-22 14:18:17 -0400 |
commit | e4268aad42e9f37d01925022830b16bab3d0d5af (patch) | |
tree | 343b114454c8a82cf3d6eb83d601253d63b6d33c /drivers/acpi/pci_slot.c | |
parent | 93ded9b8fd42abe2c3607097963d8de6ad9117eb (diff) |
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.c | 5 |
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 @@ | |||
6 | * Thanks to Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> for code | 6 | * Thanks to Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> for code |
7 | * review and fixes. | 7 | * review and fixes. |
8 | * | 8 | * |
9 | * Copyright (C) 2007 Alex Chiang <achiang@hp.com> | 9 | * Copyright (C) 2007-2008 Hewlett-Packard Development Company, L.P. |
10 | * Copyright (C) 2007 Hewlett-Packard Development Company, L.P. | 10 | * Alex Chiang <achiang@hp.com> |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 12 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms and conditions of the GNU General Public License, | 13 | * 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) | |||
158 | if (IS_ERR(pci_slot)) { | 158 | if (IS_ERR(pci_slot)) { |
159 | err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot)); | 159 | err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot)); |
160 | kfree(slot); | 160 | kfree(slot); |
161 | return AE_OK; | ||
161 | } | 162 | } |
162 | 163 | ||
163 | slot->root_handle = parent_context->root_handle; | 164 | slot->root_handle = parent_context->root_handle; |