diff options
Diffstat (limited to 'drivers/input/joydev.c')
-rw-r--r-- | drivers/input/joydev.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |