Skip to content

Commit

Permalink
Input: pmic8xxx-keypad - fix a leak of the IRQ during init failure
Browse files Browse the repository at this point in the history
Make sure we are passing the same cookie in all calls to
request_any_context_irq() and free_irq().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Axel Lin authored and Dmitry Torokhov committed Jul 19, 2011
1 parent 2c20410 commit edf21d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/input/keyboard/pmic8xxx-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,9 @@ static int __devinit pmic8xxx_kp_probe(struct platform_device *pdev)
return 0;

err_pmic_reg_read:
free_irq(kp->key_stuck_irq, NULL);
free_irq(kp->key_stuck_irq, kp);
err_req_stuck_irq:
free_irq(kp->key_sense_irq, NULL);
free_irq(kp->key_sense_irq, kp);
err_gpio_config:
err_get_irq:
input_free_device(kp->input);
Expand All @@ -716,8 +716,8 @@ static int __devexit pmic8xxx_kp_remove(struct platform_device *pdev)
struct pmic8xxx_kp *kp = platform_get_drvdata(pdev);

device_init_wakeup(&pdev->dev, 0);
free_irq(kp->key_stuck_irq, NULL);
free_irq(kp->key_sense_irq, NULL);
free_irq(kp->key_stuck_irq, kp);
free_irq(kp->key_sense_irq, kp);
input_unregister_device(kp->input);
kfree(kp);

Expand Down

0 comments on commit edf21d9

Please sign in to comment.