summaryrefslogtreecommitdiff
path: root/drivers/input/mouse/vsxxxaa.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-11-05 22:40:19 -0500
committerDmitry Torokhov <dtor@insightbb.com>2006-11-05 22:40:19 -0500
commit721556150e397f606a3f029736d77a27503f94e2 (patch)
tree1bdce32c4d1421f0dfbd9871986fcb7eaa6aba56 /drivers/input/mouse/vsxxxaa.c
parent127278ce2254c61f1346500374d61e33f74a8729 (diff)
Input: mice - handle errors when registering input devices
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/vsxxxaa.c')
-rw-r--r--drivers/input/mouse/vsxxxaa.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c
index ffdb50eee93d..ffd0d6624a8c 100644
--- a/drivers/input/mouse/vsxxxaa.c
+++ b/drivers/input/mouse/vsxxxaa.c
@@ -497,7 +497,7 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv)
mouse = kzalloc (sizeof (struct vsxxxaa), GFP_KERNEL);
input_dev = input_allocate_device ();
if (!mouse || !input_dev)
- goto fail;
+ goto fail1;
mouse->dev = input_dev;
mouse->serio = serio;
@@ -527,7 +527,7 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv)
err = serio_open (serio, drv);
if (err)
- goto fail;
+ goto fail2;
/*
* Request selftest. Standard packet format and differential
@@ -535,12 +535,15 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv)
*/
serio->write (serio, 'T'); /* Test */
- input_register_device (input_dev);
+ err = input_register_device (input_dev);
+ if (err)
+ goto fail3;
return 0;
- fail: serio_set_drvdata (serio, NULL);
- input_free_device (input_dev);
+ fail3: serio_close (serio);
+ fail2: serio_set_drvdata (serio, NULL);
+ fail1: input_free_device (input_dev);
kfree (mouse);
return err;
}