diff options
author | Oliver Neukum <oliver@neukum.org> | 2007-10-12 14:18:40 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2007-10-12 14:18:40 -0400 |
commit | 064450140f1eab959bd0eca0245f449993216074 (patch) | |
tree | ae8c7e238224b74e90f860129b1236c3eeedc470 /drivers/input/evdev.c | |
parent | 1ea3abf7fbc39b3b543d7438159ba07b6411561c (diff) | |
download | lwn-064450140f1eab959bd0eca0245f449993216074.tar.gz lwn-064450140f1eab959bd0eca0245f449993216074.zip |
Input: fix open count handling in input interfaces
If input_open_device() fails we should not leave interfaces marked
as opened.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r-- | drivers/input/evdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index bfee4f9a7715..d404aa8680ea 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -192,8 +192,11 @@ static int evdev_open_device(struct evdev *evdev) if (!evdev->exist) retval = -ENODEV; - else if (!evdev->open++) + else if (!evdev->open++) { retval = input_open_device(&evdev->handle); + if (retval) + evdev->open--; + } mutex_unlock(&evdev->mutex); return retval; |