From: Alex Chiang Date: Thu, 17 Jul 2008 17:13:32 +0000 (-0600) Subject: PCI hotplug: fix error path in pci_slot's register_slot X-Git-Tag: v2.6.27-rc1~511^2~3 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4268aad42e9f37d01925022830b16bab3d0d5af;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Jesse Barnes --- diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index b9ab030a52d..dd376f7ad09 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c @@ -6,8 +6,8 @@ * Thanks to Kenji Kaneshige for code * review and fixes. * - * Copyright (C) 2007 Alex Chiang - * Copyright (C) 2007 Hewlett-Packard Development Company, L.P. + * Copyright (C) 2007-2008 Hewlett-Packard Development Company, L.P. + * Alex Chiang * * 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;