diff options
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) | |||
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; |