diff options
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; |