Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306607
b: refs/heads/master
c: dba4258
h: refs/heads/master
i:
  306605: 7b4f000
  306603: df0422e
  306599: e94ff2b
  306591: 00d83fe
v: v3
  • Loading branch information
Dmitry Torokhov committed May 2, 2012
1 parent 3195add commit 8a843a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f31ad406693f114e57ad4651eb17deb68419c7cb
refs/heads/master: dba4258068f822b7dafc78c28fe9c99c551eca7e
8 changes: 5 additions & 3 deletions trunk/drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ static int evdev_grab(struct evdev *evdev, struct evdev_client *client)

static int evdev_ungrab(struct evdev *evdev, struct evdev_client *client)
{
if (evdev->grab != client)
struct evdev_client *grab = rcu_dereference_protected(evdev->grab,
lockdep_is_held(&evdev->mutex));

if (grab != client)
return -EINVAL;

rcu_assign_pointer(evdev->grab, NULL);
Expand Down Expand Up @@ -259,8 +262,7 @@ static int evdev_release(struct inode *inode, struct file *file)
struct evdev *evdev = client->evdev;

mutex_lock(&evdev->mutex);
if (evdev->grab == client)
evdev_ungrab(evdev, client);
evdev_ungrab(evdev, client);
mutex_unlock(&evdev->mutex);

evdev_detach_client(evdev, client);
Expand Down

0 comments on commit 8a843a8

Please sign in to comment.