diff options
Diffstat (limited to 'drivers/input/tsdev.c')
-rw-r--r-- | drivers/input/tsdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c index c189f1d..1202334 100644 --- a/drivers/input/tsdev.c +++ b/drivers/input/tsdev.c @@ -185,8 +185,11 @@ static int tsdev_open_device(struct tsdev *tsdev) if (!tsdev->exist) retval = -ENODEV; - else if (!tsdev->open++) + else if (!tsdev->open++) { retval = input_open_device(&tsdev->handle); + if (retval) + tsdev->open--; + } mutex_unlock(&tsdev->mutex); return retval; |