--- y/drivers/input/input.c +++ n/drivers/input/input.c @@ -781,9 +781,8 @@ static void input_disconnect_device(stru * not to protect access to dev->going_away but rather to ensure * that there are no threads in the middle of input_open_device() */ - mutex_lock(&dev->mutex); dev->going_away = true; - mutex_unlock(&dev->mutex); + synchronize_rcu(); spin_lock_irq(&dev->event_lock); --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -728,9 +728,8 @@ static const struct file_operations joyd */ static void joydev_mark_dead(struct joydev *joydev) { - mutex_lock(&joydev->mutex); joydev->exist = false; - mutex_unlock(&joydev->mutex); + synchronize_rcu(); } static void joydev_cleanup(struct joydev *joydev)