diff options
Diffstat (limited to 'drivers/usb/core/notify.c')
| -rw-r--r-- | drivers/usb/core/notify.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c index fe0ed54fa0a..7728c91dfa2 100644 --- a/drivers/usb/core/notify.c +++ b/drivers/usb/core/notify.c @@ -9,8 +9,8 @@ */ -#include <linux/config.h> #include <linux/kernel.h> +#include <linux/export.h> #include <linux/notifier.h> #include <linux/usb.h> #include <linux/mutex.h> @@ -34,7 +34,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) @@ -51,8 +51,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) |
