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