diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2007-04-12 01:30:15 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-04-12 01:30:15 -0400 |
commit | d542ed82fdc72cf63549deec19e86ee4addf2499 (patch) | |
tree | 201c713b24a429d34272998ae3ecca87c937709a /drivers/input/tsdev.c | |
parent | d0ffb9be866519775da19c0a6790f5431c1a8dc6 (diff) |
Input: handlers - handle errors from input_open_device()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tsdev.c')
-rw-r--r-- | drivers/input/tsdev.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c index fbef35d2d76c..8e2d2c924adf 100644 --- a/drivers/input/tsdev.c +++ b/drivers/input/tsdev.c | |||
@@ -151,6 +151,7 @@ static int tsdev_open(struct inode *inode, struct file *file) | |||
151 | int i = iminor(inode) - TSDEV_MINOR_BASE; | 151 | int i = iminor(inode) - TSDEV_MINOR_BASE; |
152 | struct tsdev_client *client; | 152 | struct tsdev_client *client; |
153 | struct tsdev *tsdev; | 153 | struct tsdev *tsdev; |
154 | int error; | ||
154 | 155 | ||
155 | printk(KERN_WARNING "tsdev (compaq touchscreen emulation) is scheduled " | 156 | printk(KERN_WARNING "tsdev (compaq touchscreen emulation) is scheduled " |
156 | "for removal.\nSee Documentation/feature-removal-schedule.txt " | 157 | "for removal.\nSee Documentation/feature-removal-schedule.txt " |
@@ -171,8 +172,14 @@ static int tsdev_open(struct inode *inode, struct file *file) | |||
171 | client->raw = (i >= TSDEV_MINORS / 2) ? 1 : 0; | 172 | client->raw = (i >= TSDEV_MINORS / 2) ? 1 : 0; |
172 | list_add_tail(&client->node, &tsdev->client_list); | 173 | list_add_tail(&client->node, &tsdev->client_list); |
173 | 174 | ||
174 | if (!tsdev->open++ && tsdev->exist) | 175 | if (!tsdev->open++ && tsdev->exist) { |
175 | input_open_device(&tsdev->handle); | 176 | error = input_open_device(&tsdev->handle); |
177 | if (error) { | ||
178 | list_del(&client->node); | ||
179 | kfree(client); | ||
180 | return error; | ||
181 | } | ||
182 | } | ||
176 | 183 | ||
177 | file->private_data = client; | 184 | file->private_data = client; |
178 | return 0; | 185 | return 0; |