Commit 1bded471 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[PATCH] Fix ide-mod unload crash

This patch fixes an unload crash when no PCI drivers are loaded.
parent eba85e7b
...@@ -909,16 +909,11 @@ EXPORT_SYMBOL(proc_ide_create); ...@@ -909,16 +909,11 @@ EXPORT_SYMBOL(proc_ide_create);
void proc_ide_destroy(void) void proc_ide_destroy(void)
{ {
#ifdef CONFIG_BLK_DEV_IDEPCI #ifdef CONFIG_BLK_DEV_IDEPCI
ide_pci_host_proc_t *p = ide_pci_host_proc_list; ide_pci_host_proc_t *p;
char name[32];
while ((p->name != NULL) && (p->set) && (p->get_info != NULL)) { for (p = ide_pci_host_proc_list; p; p = p->next) {
name[0] = '\0';
sprintf(name, "ide/%s", p->name);
if (p->set == 2) if (p->set == 2)
remove_proc_entry(p->name, p->parent); remove_proc_entry(p->name, p->parent);
if (p->next == NULL) break;
p = p->next;
} }
#endif /* CONFIG_BLK_DEV_IDEPCI */ #endif /* CONFIG_BLK_DEV_IDEPCI */
remove_proc_entry("ide/drivers", proc_ide_root); remove_proc_entry("ide/drivers", proc_ide_root);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment