diff options
Diffstat (limited to 'drivers/input/joydev.c')
-rw-r--r-- | drivers/input/joydev.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index f306c97..2b201f9 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -149,8 +149,10 @@ static void joydev_event(struct input_handle *handle, event.time = jiffies_to_msecs(jiffies); + rcu_read_lock(); list_for_each_entry_rcu(client, &joydev->client_list, node) joydev_pass_event(client, &event); + rcu_read_unlock(); wake_up_interruptible(&joydev->wait); } @@ -178,12 +180,7 @@ static void joydev_attach_client(struct joydev *joydev, spin_lock(&joydev->client_lock); list_add_tail_rcu(&client->node, &joydev->client_list); spin_unlock(&joydev->client_lock); - /* - * We don't use synchronize_rcu() here because read-side - * critical section is protected by a spinlock (dev->event_lock) - * instead of rcu_read_lock(). - */ - synchronize_sched(); + synchronize_rcu(); } static void joydev_detach_client(struct joydev *joydev, @@ -192,7 +189,7 @@ static void joydev_detach_client(struct joydev *joydev, spin_lock(&joydev->client_lock); list_del_rcu(&client->node); spin_unlock(&joydev->client_lock); - synchronize_sched(); + synchronize_rcu(); } static int joydev_open_device(struct joydev *joydev) |