Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4268aad authored by Alex Chiang's avatar Alex Chiang Committed by Jesse Barnes
Browse files

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: default avatarAlex Chiang <achiang@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 93ded9b8
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -6,8 +6,8 @@
 *  Thanks to Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> for code
 *  Thanks to Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> for code
 *  review and fixes.
 *  review and fixes.
 *
 *
 *  Copyright (C) 2007 Alex Chiang <achiang@hp.com>
 *  Copyright (C) 2007-2008 Hewlett-Packard Development Company, L.P.
 *  Copyright (C) 2007 Hewlett-Packard Development Company, L.P.
 *  	Alex Chiang <achiang@hp.com>
 *
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms and conditions of the GNU General Public License,
 *  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)) {
	if (IS_ERR(pci_slot)) {
		err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot));
		err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot));
		kfree(slot);
		kfree(slot);
		return AE_OK;
	}
	}


	slot->root_handle = parent_context->root_handle;
	slot->root_handle = parent_context->root_handle;