diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-05 22:40:03 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-05 22:40:03 -0500 |
commit | 52c1f5704d7555a16641429b2e7af5d26d7b119a (patch) | |
tree | eb55cec7167646ba18f09d7d4b0009712fe45062 /drivers/input/touchscreen/gunze.c | |
parent | 2b03b60e6b8635fffdd15d5d24943950f2bbf96e (diff) |
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) | |||
123 | input_dev = input_allocate_device(); | 123 | input_dev = input_allocate_device(); |
124 | if (!gunze || !input_dev) { | 124 | if (!gunze || !input_dev) { |
125 | err = -ENOMEM; | 125 | err = -ENOMEM; |
126 | goto fail; | 126 | goto fail1; |
127 | } | 127 | } |
128 | 128 | ||
129 | gunze->serio = serio; | 129 | gunze->serio = serio; |
@@ -146,13 +146,17 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv) | |||
146 | 146 | ||
147 | err = serio_open(serio, drv); | 147 | err = serio_open(serio, drv); |
148 | if (err) | 148 | if (err) |
149 | goto fail; | 149 | goto fail2; |
150 | |||
151 | err = input_register_device(gunze->dev); | ||
152 | if (err) | ||
153 | goto fail3; | ||
150 | 154 | ||
151 | input_register_device(gunze->dev); | ||
152 | return 0; | 155 | return 0; |
153 | 156 | ||
154 | fail: serio_set_drvdata(serio, NULL); | 157 | fail3: serio_close(serio); |
155 | input_free_device(input_dev); | 158 | fail2: serio_set_drvdata(serio, NULL); |
159 | fail1: input_free_device(input_dev); | ||
156 | kfree(gunze); | 160 | kfree(gunze); |
157 | return err; | 161 | return err; |
158 | } | 162 | } |