Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] shpchp: fix oops at driver unload

At unload time, the shpchp driver does not remove sysfs files
it had created in the driver's probe entry point. This patch
fixes this problem.

Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

rajesh.shah@intel.com and committed by
Greg Kroah-Hartman
c2608a11 7c8942f9

+7
+1
drivers/pci/hotplug/shpchp.h
··· 173 173 struct hotplug_params *hpp); 174 174 extern int shpchprm_get_physical_slot_number(struct controller *ctrl, 175 175 u32 *sun, u8 busnum, u8 devnum); 176 + extern void shpchp_remove_ctrl_files(struct controller *ctrl); 176 177 177 178 178 179 /* Global variables */
+1
drivers/pci/hotplug/shpchp_core.c
··· 480 480 ctrl = shpchp_ctrl_list; 481 481 482 482 while (ctrl) { 483 + shpchp_remove_ctrl_files(ctrl); 483 484 cleanup_slots(ctrl); 484 485 485 486 kfree (ctrl->pci_bus);
+5
drivers/pci/hotplug/shpchp_sysfs.c
··· 89 89 { 90 90 device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl); 91 91 } 92 + 93 + void shpchp_remove_ctrl_files(struct controller *ctrl) 94 + { 95 + device_remove_file(&ctrl->pci_dev->dev, &dev_attr_ctrl); 96 + }