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/cobra.c | |
parent | 52c1f5704d7555a16641429b2e7af5d26d7b119a (diff) | |
download | talos-op-linux-127278ce2254c61f1346500374d61e33f74a8729.tar.gz talos-op-linux-127278ce2254c61f1346500374d61e33f74a8729.zip |
Input: joysticks - handle errors when registering input devices
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joystick/cobra.c')
-rw-r--r-- | drivers/input/joystick/cobra.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c index d5e42eb88a20..034ec39c251d 100644 --- a/drivers/input/joystick/cobra.c +++ b/drivers/input/joystick/cobra.c @@ -223,12 +223,15 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv) for (j = 0; cobra_btn[j]; j++) set_bit(cobra_btn[j], input_dev->keybit); - input_register_device(cobra->dev[i]); + err = input_register_device(cobra->dev[i]); + if (err) + goto fail4; } return 0; - fail3: for (i = 0; i < 2; i++) + fail4: input_free_device(cobra->dev[i]); + fail3: while (--i >= 0) if (cobra->dev[i]) input_unregister_device(cobra->dev[i]); fail2: gameport_close(gameport); |