diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-06 06:40:03 +0300 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-06 06:40:03 +0300 |
commit | 52c1f5704d7555a16641429b2e7af5d26d7b119a (patch) | |
tree | eb55cec7167646ba18f09d7d4b0009712fe45062 /drivers/input/touchscreen/gunze.c | |
parent | 2b03b60e6b8635fffdd15d5d24943950f2bbf96e (diff) | |
download | linux-52c1f5704d7555a16641429b2e7af5d26d7b119a.tar.xz |
Input: touchscreens - handle errors when registering input devices
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen/gunze.c')
-rw-r--r-- | drivers/input/touchscreen/gunze.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c index 817c2198933d..44f397fff715 100644 --- a/drivers/input/touchscreen/gunze.c +++ b/drivers/input/touchscreen/gunze.c @@ -123,7 +123,7 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv) input_dev = input_allocate_device(); if (!gunze || !input_dev) { err = -ENOMEM; - goto fail; + goto fail1; } gunze->serio = serio; @@ -146,13 +146,17 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv) err = serio_open(serio, drv); if (err) - goto fail; + goto fail2; + + err = input_register_device(gunze->dev); + if (err) + goto fail3; - input_register_device(gunze->dev); 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(gunze); return err; } |