X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fusb%2Fcore%2Fnotify.c;fp=drivers%2Fusb%2Fcore%2Fnotify.c;h=6b36897ca151998ab28f07c12f0e9baef9e372fe;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=fe0ed54fa0ae1b982c8ea1e94d15dfdf8d568bb5;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c index fe0ed54fa..6b36897ca 100644 --- a/drivers/usb/core/notify.c +++ b/drivers/usb/core/notify.c @@ -9,7 +9,6 @@ */ -#include #include #include #include @@ -51,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)