diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-05 22:40:19 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-05 22:40:19 -0500 |
commit | 721556150e397f606a3f029736d77a27503f94e2 (patch) | |
tree | 1bdce32c4d1421f0dfbd9871986fcb7eaa6aba56 /drivers/input/mouse/vsxxxaa.c | |
parent | 127278ce2254c61f1346500374d61e33f74a8729 (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.c | 13 |
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) | |||
497 | mouse = kzalloc (sizeof (struct vsxxxaa), GFP_KERNEL); | 497 | mouse = kzalloc (sizeof (struct vsxxxaa), GFP_KERNEL); |
498 | input_dev = input_allocate_device (); | 498 | input_dev = input_allocate_device (); |
499 | if (!mouse || !input_dev) | 499 | if (!mouse || !input_dev) |
500 | goto fail; | 500 | goto fail1; |
501 | 501 | ||
502 | mouse->dev = input_dev; | 502 | mouse->dev = input_dev; |
503 | mouse->serio = serio; | 503 | mouse->serio = serio; |
@@ -527,7 +527,7 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv) | |||
527 | 527 | ||
528 | err = serio_open (serio, drv); | 528 | err = serio_open (serio, drv); |
529 | if (err) | 529 | if (err) |
530 | goto fail; | 530 | goto fail2; |
531 | 531 | ||
532 | /* | 532 | /* |
533 | * Request selftest. Standard packet format and differential | 533 | * Request selftest. Standard packet format and differential |
@@ -535,12 +535,15 @@ vsxxxaa_connect (struct serio *serio, struct serio_driver *drv) | |||
535 | */ | 535 | */ |
536 | serio->write (serio, 'T'); /* Test */ | 536 | serio->write (serio, 'T'); /* Test */ |
537 | 537 | ||
538 | input_register_device (input_dev); | 538 | err = input_register_device (input_dev); |
539 | if (err) | ||
540 | goto fail3; | ||
539 | 541 | ||
540 | return 0; | 542 | return 0; |
541 | 543 | ||
542 | fail: serio_set_drvdata (serio, NULL); | 544 | fail3: serio_close (serio); |
543 | input_free_device (input_dev); | 545 | fail2: serio_set_drvdata (serio, NULL); |
546 | fail1: input_free_device (input_dev); | ||
544 | kfree (mouse); | 547 | kfree (mouse); |
545 | return err; | 548 | return err; |
546 | } | 549 | } |