From: Alex Chiang Date: Mon, 30 Mar 2009 16:50:19 +0000 (-0600) Subject: PCI: pci_slot: grab refcount on slot's bus X-Git-Tag: v2.6.30-rc1~5^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72800360fdd782eda3489e555adf3b6b3abc064a;p=pandora-kernel.git PCI: pci_slot: grab refcount on slot's bus If a logical hot unplug (remove) is performed on a physical PCI slot's parent bridge, and then pci_slot is unloaded, we will encounter an oops: [] kobject_release+0x9a/0x290 [] ? kobject_release+0x0/0x290 [] kref_put+0x37/0x80 [] kobject_put+0x27/0x60 [] ? pci_destroy_slot+0x3c/0xc0 [] pci_destroy_slot+0x45/0xc0 [] acpi_pci_slot_remove+0x5c/0x91 [pci_slot] [] acpi_pci_unregister_driver+0x4b/0x62 [] acpi_pci_slot_exit+0x10/0x12 [pci_slot] [] sys_delete_module+0x161/0x250 We need to grab a reference to the parent PCI bus, which will pin the bus and prevent it from being released until pci_slot is unloaded. Cc: lenb@kernel.org Reviewed-by: Kenji Kaneshige Tested-by: Kenji Kaneshige Reported-by: Kenji Kaneshige Signed-off-by: Alex Chiang Signed-off-by: Jesse Barnes --- Reading git-diff-tree failed