git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Input: fix open count handling in input interfaces
[safe/jmp/linux-2.6]
/
drivers
/
input
/
joydev.c
diff --git
a/drivers/input/joydev.c
b/drivers/input/joydev.c
index
a4272d6
..
f306c97
100644
(file)
--- a/
drivers/input/joydev.c
+++ b/
drivers/input/joydev.c
@@
-205,8
+205,11
@@
static int joydev_open_device(struct joydev *joydev)
if (!joydev->exist)
retval = -ENODEV;
- else if (!joydev->open++)
+ else if (!joydev->open++)
{
retval = input_open_device(&joydev->handle);
+ if (retval)
+ joydev->open--;
+ }
mutex_unlock(&joydev->mutex);
return retval;