X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fusb%2Fcore%2Fnotify.c;h=6b36897ca151998ab28f07c12f0e9baef9e372fe;hb=eaafbc3a8adab16babe2c20e54ad3ba40d1fbbc9;hp=b042676af0a5b11b70b1fa9e422aba2de4f2a551;hpb=c4e00fac42f268ed0a547cdd1d12bb8399864040;p=powerpc.git diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c index b042676af0..6b36897ca1 100644 --- a/drivers/usb/core/notify.c +++ b/drivers/usb/core/notify.c @@ -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)