diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-05 22:40:09 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-05 22:40:09 -0500 |
commit | 127278ce2254c61f1346500374d61e33f74a8729 (patch) | |
tree | f7460f3f452d3dbe2d7a52dfa23a51dee0d312f3 /drivers/input/joystick/iforce/iforce-serio.c | |
parent | 52c1f5704d7555a16641429b2e7af5d26d7b119a (diff) | |
download | kernel_samsung_smdk4412-127278ce2254c61f1346500374d61e33f74a8729.zip kernel_samsung_smdk4412-127278ce2254c61f1346500374d61e33f74a8729.tar.gz kernel_samsung_smdk4412-127278ce2254c61f1346500374d61e33f74a8729.tar.bz2 |
Input: joysticks - handle errors when registering input devices
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joystick/iforce/iforce-serio.c')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-serio.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c index ca08f45..ec4be53 100644 --- a/drivers/input/joystick/iforce/iforce-serio.c +++ b/drivers/input/joystick/iforce/iforce-serio.c @@ -141,21 +141,19 @@ static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) serio_set_drvdata(serio, iforce); err = serio_open(serio, drv); - if (err) { - serio_set_drvdata(serio, NULL); - kfree(iforce); - return err; - } + if (err) + goto fail1; err = iforce_init_device(iforce); - if (err) { - serio_close(serio); - serio_set_drvdata(serio, NULL); - kfree(iforce); - return -ENODEV; - } + if (err) + goto fail2; return 0; + + fail2: serio_close(serio); + fail1: serio_set_drvdata(serio, NULL); + kfree(iforce); + return err; } static void iforce_serio_disconnect(struct serio *serio) |