public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: hotplug: fix error path in pci_slot's register_slot
@ 2008-07-17 17:13 Alex Chiang
  2008-07-22 18:20 ` Jesse Barnes
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Chiang @ 2008-07-17 17:13 UTC (permalink / raw)
  To: jbarnes; +Cc: juha_motorsportcom, linux-pci, linux-kernel

Juha Leppänen 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>

diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
index b9ab030..dd376f7 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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: hotplug: fix error path in pci_slot's register_slot
  2008-07-17 17:13 [PATCH] PCI: hotplug: fix error path in pci_slot's register_slot Alex Chiang
@ 2008-07-22 18:20 ` Jesse Barnes
  0 siblings, 0 replies; 2+ messages in thread
From: Jesse Barnes @ 2008-07-22 18:20 UTC (permalink / raw)
  To: Alex Chiang; +Cc: juha_motorsportcom, linux-pci, linux-kernel

On Thursday, July 17, 2008 10:13 am Alex Chiang wrote:
> Juha Leppänen 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>

Thanks Alex & Juha, I've applied this to my for-linus tree.

Jesse

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-22 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 17:13 [PATCH] PCI: hotplug: fix error path in pci_slot's register_slot Alex Chiang
2008-07-22 18:20 ` Jesse Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox