Commit adc4633c86f3358fce676b6c7ce75055e395123a

Authored by Dmitry Torokhov
1 parent 5161870f51

Input: fix sparse warning in __input_release_device()

This fixes the following warning:
drivers/input/input.c:538:23: error: incompatible types in comparison expression (different address spaces)

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

drivers/input/input.c
... ... @@ -534,8 +534,11 @@
534 534 static void __input_release_device(struct input_handle *handle)
535 535 {
536 536 struct input_dev *dev = handle->dev;
  537 + struct input_handle *grabber;
537 538  
538   - if (dev->grab == handle) {
  539 + grabber = rcu_dereference_protected(dev->grab,
  540 + lockdep_is_held(&dev->mutex));
  541 + if (grabber == handle) {
539 542 rcu_assign_pointer(dev->grab, NULL);
540 543 /* Make sure input_pass_event() notices that grab is gone */
541 544 synchronize_rcu();