Input: handlers - handle errors from input_open_device()

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Dmitry Torokhov
2007-04-12 01:30:15 -04:00
parent d0ffb9be86
commit d542ed82fd
4 changed files with 107 additions and 40 deletions
+9 -2
View File
@@ -151,6 +151,7 @@ static int tsdev_open(struct inode *inode, struct file *file)
int i = iminor(inode) - TSDEV_MINOR_BASE;
struct tsdev_client *client;
struct tsdev *tsdev;
int error;
printk(KERN_WARNING "tsdev (compaq touchscreen emulation) is scheduled "
"for removal.\nSee Documentation/feature-removal-schedule.txt "
@@ -171,8 +172,14 @@ static int tsdev_open(struct inode *inode, struct file *file)
client->raw = (i >= TSDEV_MINORS / 2) ? 1 : 0;
list_add_tail(&client->node, &tsdev->client_list);
if (!tsdev->open++ && tsdev->exist)
input_open_device(&tsdev->handle);
if (!tsdev->open++ && tsdev->exist) {
error = input_open_device(&tsdev->handle);
if (error) {
list_del(&client->node);
kfree(client);
return error;
}
}
file->private_data = client;
return 0;