diff options
author | Oliver Neukum <oliver@neukum.org> | 2007-10-12 20:18:40 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2007-10-12 20:18:40 +0200 |
commit | 064450140f1eab959bd0eca0245f449993216074 (patch) | |
tree | ae8c7e238224b74e90f860129b1236c3eeedc470 /drivers/input/mousedev.c | |
parent | Input: keyboard - add CapsShift lock (diff) | |
download | linux-064450140f1eab959bd0eca0245f449993216074.tar.xz linux-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/mousedev.c')
-rw-r--r-- | drivers/input/mousedev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 715def79390c..cc36edbb912f 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -428,8 +428,11 @@ static int mousedev_open_device(struct mousedev *mousedev) mixdev_open_devices(); else if (!mousedev->exist) retval = -ENODEV; - else if (!mousedev->open++) + else if (!mousedev->open++) { retval = input_open_device(&mousedev->handle); + if (retval) + mousedev->open--; + } mutex_unlock(&mousedev->mutex); return retval; |