diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/evdev.c | 5 | ||||
-rw-r--r-- | drivers/input/joydev.c | 5 | ||||
-rw-r--r-- | drivers/input/mousedev.c | 5 | ||||
-rw-r--r-- | drivers/input/tsdev.c | 5 |
4 files changed, 16 insertions, 4 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) | |||
192 | 192 | ||
193 | if (!evdev->exist) | 193 | if (!evdev->exist) |
194 | retval = -ENODEV; | 194 | retval = -ENODEV; |
195 | else if (!evdev->open++) | 195 | else if (!evdev->open++) { |
196 | retval = input_open_device(&evdev->handle); | 196 | retval = input_open_device(&evdev->handle); |
197 | if (retval) | ||
198 | evdev->open--; | ||
199 | } | ||
197 | 200 | ||
198 | mutex_unlock(&evdev->mutex); | 201 | mutex_unlock(&evdev->mutex); |
199 | return retval; | 202 | return retval; |
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index a4272d63c4d6..f306c97f556d 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
@@ -205,8 +205,11 @@ static int joydev_open_device(struct joydev *joydev) | |||
205 | 205 | ||
206 | if (!joydev->exist) | 206 | if (!joydev->exist) |
207 | retval = -ENODEV; | 207 | retval = -ENODEV; |
208 | else if (!joydev->open++) | 208 | else if (!joydev->open++) { |
209 | retval = input_open_device(&joydev->handle); | 209 | retval = input_open_device(&joydev->handle); |
210 | if (retval) | ||
211 | joydev->open--; | ||
212 | } | ||
210 | 213 | ||
211 | mutex_unlock(&joydev->mutex); | 214 | mutex_unlock(&joydev->mutex); |
212 | return retval; | 215 | return retval; |
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) | |||
428 | mixdev_open_devices(); | 428 | mixdev_open_devices(); |
429 | else if (!mousedev->exist) | 429 | else if (!mousedev->exist) |
430 | retval = -ENODEV; | 430 | retval = -ENODEV; |
431 | else if (!mousedev->open++) | 431 | else if (!mousedev->open++) { |
432 | retval = input_open_device(&mousedev->handle); | 432 | retval = input_open_device(&mousedev->handle); |
433 | if (retval) | ||
434 | mousedev->open--; | ||
435 | } | ||
433 | 436 | ||
434 | mutex_unlock(&mousedev->mutex); | 437 | mutex_unlock(&mousedev->mutex); |
435 | return retval; | 438 | return retval; |
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c index c189f1dd569f..120233493758 100644 --- a/drivers/input/tsdev.c +++ b/drivers/input/tsdev.c | |||
@@ -185,8 +185,11 @@ static int tsdev_open_device(struct tsdev *tsdev) | |||
185 | 185 | ||
186 | if (!tsdev->exist) | 186 | if (!tsdev->exist) |
187 | retval = -ENODEV; | 187 | retval = -ENODEV; |
188 | else if (!tsdev->open++) | 188 | else if (!tsdev->open++) { |
189 | retval = input_open_device(&tsdev->handle); | 189 | retval = input_open_device(&tsdev->handle); |
190 | if (retval) | ||
191 | tsdev->open--; | ||
192 | } | ||
190 | 193 | ||
191 | mutex_unlock(&tsdev->mutex); | 194 | mutex_unlock(&tsdev->mutex); |
192 | return retval; | 195 | return retval; |