lkml.org 
[lkml]   [2006]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Properly unregister reboot notifier in case of failure in ehci hcd
Hi,

If some problem occurs during ehci startup, for instance, request_irq fails, echi hcd driver
tries it best to cleanup, but fails to unregister reboot notifier, which in turn leads to crash on
reboot/poweroff. Below is the patch against current git to fix this.
I did not check if the same problem existed for uhci/ohci host drivers.

Signed off by: Aleks Gorelov <dared1st@yahoo.com>

--- linux-2.6/drivers/usb/host/ehci-hcd.c-orig 2006-07-11 17:27:54.000000000 -0700
+++ linux-2.6/drivers/usb/host/ehci-hcd.c 2006-07-11 17:27:20.000000000 -0700
@@ -483,9 +483,6 @@
}
ehci->command = temp;

- ehci->reboot_notifier.notifier_call = ehci_reboot;
- register_reboot_notifier(&ehci->reboot_notifier);
-
return 0;
}

@@ -499,7 +496,6 @@

/* EHCI spec section 4.1 */
if ((retval = ehci_reset(ehci)) != 0) {
- unregister_reboot_notifier(&ehci->reboot_notifier);
ehci_mem_cleanup(ehci);
return retval;
}
@@ -560,6 +556,9 @@
*/
create_debug_files(ehci);

+ ehci->reboot_notifier.notifier_call = ehci_reboot;
+ register_reboot_notifier(&ehci->reboot_notifier);
+
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-12 08:41    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site