X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fusb%2Fcore%2Fnotify.c;h=7542dce3f5a1e2b01bcbd2ef78c08bd870c31b1a;hb=2e4f40d2eb763a17c75c07fff605402737260c59;hp=b042676af0a5b11b70b1fa9e422aba2de4f2a551;hpb=ae3e0218621db0590163b2d5c424ef1f340e3cc6;p=linux-2.6-omap-h63xx.git diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c index b042676af0a..7542dce3f5a 100644 --- a/drivers/usb/core/notify.c +++ b/drivers/usb/core/notify.c @@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(usb_register_notify); * usb_unregister_notify - unregister a notifier callback * @nb: pointer to the notifier block for the callback events. * - * usb_register_notifier() must have been previously called for this function + * usb_register_notify() must have been previously called for this function * to work properly. */ void usb_unregister_notify(struct notifier_block *nb) @@ -50,8 +50,11 @@ void usb_notify_add_device(struct usb_device *udev) void usb_notify_remove_device(struct usb_device *udev) { + /* Protect against simultaneous usbfs open */ + mutex_lock(&usbfs_mutex); blocking_notifier_call_chain(&usb_notifier_list, USB_DEVICE_REMOVE, udev); + mutex_unlock(&usbfs_mutex); } void usb_notify_add_bus(struct usb_bus *ubus)