diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-08-05 00:27:00 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-08-05 00:27:00 -0400 |
commit | 6b50d8b862284929314e9ff09e5b1cce2c43d32b (patch) | |
tree | 76b6358dff4bfe18342fb02817e1dc54db4e1cd0 /drivers/input | |
parent | f287caee8094097e3901d9982b6780873b36944f (diff) | |
download | kernel_samsung_crespo-6b50d8b862284929314e9ff09e5b1cce2c43d32b.zip kernel_samsung_crespo-6b50d8b862284929314e9ff09e5b1cce2c43d32b.tar.gz kernel_samsung_crespo-6b50d8b862284929314e9ff09e5b1cce2c43d32b.tar.bz2 |
Input: elo - handle input_register_device() failures
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/elo.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/elo.c b/drivers/input/touchscreen/elo.c index c86a2eb..b7ac016 100644 --- a/drivers/input/touchscreen/elo.c +++ b/drivers/input/touchscreen/elo.c @@ -187,11 +187,13 @@ static irqreturn_t elo_interrupt(struct serio *serio, static void elo_disconnect(struct serio *serio) { - struct elo* elo = serio_get_drvdata(serio); + struct elo *elo = serio_get_drvdata(serio); + input_get_device(elo->dev); input_unregister_device(elo->dev); serio_close(serio); serio_set_drvdata(serio, NULL); + input_put_device(elo->dev); kfree(elo); } @@ -211,7 +213,7 @@ static int elo_connect(struct serio *serio, struct serio_driver *drv) input_dev = input_allocate_device(); if (!elo || !input_dev) { err = -ENOMEM; - goto fail; + goto fail1; } elo->serio = serio; @@ -257,13 +259,17 @@ static int elo_connect(struct serio *serio, struct serio_driver *drv) err = serio_open(serio, drv); if (err) - goto fail; + goto fail2; + + err = input_register_device(elo->dev); + if (err) + goto fail3; - input_register_device(elo->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(elo); return err; } |