aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-09-29 21:36:00 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-10-13 10:49:24 -0400
commita9cc0202227caa4adb5e823d5fbce7790364941f (patch)
tree4a47075935391b4510597cae52e10c4d9de46444
parent6792cbbb254712a8c0fa8a4c97c8d521c7c41c28 (diff)
Input: twl4030_keypad - fix error handling path
We should not try to call free_irq() when request_irq() failed. Reported-by: G, Manjunath Kondaiah <manjugk@ti.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/keyboard/twl4030_keypad.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index fb16b5e5ea13..09bef79d9da1 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -406,23 +406,22 @@ static int __devinit twl4030_kp_probe(struct platform_device *pdev)
406 if (error) { 406 if (error) {
407 dev_info(kp->dbg_dev, "request_irq failed for irq no=%d\n", 407 dev_info(kp->dbg_dev, "request_irq failed for irq no=%d\n",
408 kp->irq); 408 kp->irq);
409 goto err3; 409 goto err2;
410 } 410 }
411 411
412 /* Enable KP and TO interrupts now. */ 412 /* Enable KP and TO interrupts now. */
413 reg = (u8) ~(KEYP_IMR1_KP | KEYP_IMR1_TO); 413 reg = (u8) ~(KEYP_IMR1_KP | KEYP_IMR1_TO);
414 if (twl4030_kpwrite_u8(kp, reg, KEYP_IMR1)) { 414 if (twl4030_kpwrite_u8(kp, reg, KEYP_IMR1)) {
415 error = -EIO; 415 error = -EIO;
416 goto err4; 416 goto err3;
417 } 417 }
418 418
419 platform_set_drvdata(pdev, kp); 419 platform_set_drvdata(pdev, kp);
420 return 0; 420 return 0;
421 421
422err4: 422err3:
423 /* mask all events - we don't care about the result */ 423 /* mask all events - we don't care about the result */
424 (void) twl4030_kpwrite_u8(kp, 0xff, KEYP_IMR1); 424 (void) twl4030_kpwrite_u8(kp, 0xff, KEYP_IMR1);
425err3:
426 free_irq(kp->irq, NULL); 425 free_irq(kp->irq, NULL);
427err2: 426err2:
428 input_unregister_device(input); 427 input_unregister_device(input);