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 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; |