Skip to contentSkip to conversation

Input: pmic8xxx-keypad - fix a leak of the IRQ during init failure

PATCH In review Axel Lin 2 participants 2 messages Jul 14, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 Input: pmic8xxx-keypad - fix a leak of the IRQ during init failure

Make sure we are passing the same cookie in all calls to request_any_context_irq() and free_irq().

---
 drivers/input/keyboard/pmic8xxx-keypad.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/input/keyboard/pmic8xxx-keypad.c +4 -4
index 6229c3e..e7cc51d 100644
@@ -700,9 +700,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);
@@ -717,8 +717,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);
 
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Axel Lin

Make sure we are passing the same cookie in all calls to request_any_context_irq() and free_irq().

Quoted 31 lines
---
  drivers/input/keyboard/pmic8xxx-keypad.c |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)
drivers/input/keyboard/pmic8xxx-keypad.c +4 -4
index 6229c3e..e7cc51d 100644
@@ -700,9 +700,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);
@@ -717,8 +717,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);