linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq()
@ 2013-05-20 14:51 Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 2/7] input: pxa27x_keypad: " Lars-Peter Clausen
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-05-20 14:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Lars-Peter Clausen, H Hartley Sweeten

free_irq() expects the same pointer that was passed to request_irq(), otherwise
the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

Cc: H Hartley Sweeten <hartleys@visionengravers.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/input/keyboard/ep93xx_keypad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index a8d5aac..47206bd 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -329,7 +329,7 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
 	return 0;
 
 failed_free_irq:
-	free_irq(keypad->irq, pdev);
+	free_irq(keypad->irq, keypad);
 failed_free_dev:
 	input_free_device(input_dev);
 failed_put_clk:
@@ -350,7 +350,7 @@ static int ep93xx_keypad_remove(struct platform_device *pdev)
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
 	struct resource *res;
 
-	free_irq(keypad->irq, pdev);
+	free_irq(keypad->irq, keypad);
 
 	if (keypad->enabled)
 		clk_disable(keypad->clk);
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/7] input: pxa27x_keypad: Pass correct pointer to free_irq()
  2013-05-20 14:51 [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq() Lars-Peter Clausen
@ 2013-05-20 14:51 ` Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 3/7] input: twl4030_keypad: " Lars-Peter Clausen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-05-20 14:51 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Lars-Peter Clausen

free_irq() expects the same pointer that was passed to request_irq(), otherwise
the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/input/keyboard/pxa27x_keypad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 74e30cc..b674e7a 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -582,7 +582,7 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
 	return 0;
 
 failed_free_irq:
-	free_irq(irq, pdev);
+	free_irq(irq, keypad);
 failed_put_clk:
 	clk_put(keypad->clk);
 failed_free_io:
@@ -600,7 +600,7 @@ static int pxa27x_keypad_remove(struct platform_device *pdev)
 	struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
 	struct resource *res;
 
-	free_irq(keypad->irq, pdev);
+	free_irq(keypad->irq, keypad);
 	clk_put(keypad->clk);
 
 	input_unregister_device(keypad->input_dev);
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/7] input: twl4030_keypad: Pass correct pointer to free_irq()
  2013-05-20 14:51 [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq() Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 2/7] input: pxa27x_keypad: " Lars-Peter Clausen
@ 2013-05-20 14:51 ` Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 4/7] input: w90p910_keypad: " Lars-Peter Clausen
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-05-20 14:51 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Lars-Peter Clausen

free_irq() expects the same pointer that was passed to request_threaded_irq(),
otherwise the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_threaded_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/input/keyboard/twl4030_keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index f05ee1db..d2d178c 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -422,7 +422,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
 err3:
 	/* mask all events - we don't care about the result */
 	(void) twl4030_kpwrite_u8(kp, 0xff, KEYP_IMR1);
-	free_irq(kp->irq, NULL);
+	free_irq(kp->irq, kp);
 err2:
 	input_unregister_device(input);
 	input = NULL;
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/7] input: w90p910_keypad: Pass correct pointer to free_irq()
  2013-05-20 14:51 [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq() Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 2/7] input: pxa27x_keypad: " Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 3/7] input: twl4030_keypad: " Lars-Peter Clausen
@ 2013-05-20 14:51 ` Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 5/7] input: ixp4xx-beeper: " Lars-Peter Clausen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-05-20 14:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Lars-Peter Clausen, Wan ZongShun

free_irq() expects the same pointer that was passed to request_irq(), otherwise
the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

Cc: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/input/keyboard/w90p910_keypad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c
index 72e6a56..7b03916 100644
--- a/drivers/input/keyboard/w90p910_keypad.c
+++ b/drivers/input/keyboard/w90p910_keypad.c
@@ -221,7 +221,7 @@ static int w90p910_keypad_probe(struct platform_device *pdev)
 	return 0;
 
 failed_free_irq:
-	free_irq(irq, pdev);
+	free_irq(irq, keypad);
 failed_put_clk:
 	clk_put(keypad->clk);
 failed_free_io:
@@ -239,7 +239,7 @@ static int w90p910_keypad_remove(struct platform_device *pdev)
 	struct w90p910_keypad *keypad = platform_get_drvdata(pdev);
 	struct resource *res;
 
-	free_irq(keypad->irq, pdev);
+	free_irq(keypad->irq, keypad);
 
 	clk_put(keypad->clk);
 
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/7] input: ixp4xx-beeper: Pass correct pointer to free_irq()
  2013-05-20 14:51 [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq() Lars-Peter Clausen
                   ` (2 preceding siblings ...)
  2013-05-20 14:51 ` [PATCH 4/7] input: w90p910_keypad: " Lars-Peter Clausen
@ 2013-05-20 14:51 ` Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 6/7] input: pmic8xxx-pwrkey: " Lars-Peter Clausen
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-05-20 14:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Lars-Peter Clausen, Alessandro Zummo

free_irq() expects the same pointer that was passed to request_irq(), otherwise
the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/input/misc/ixp4xx-beeper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c
index 6ab3dec..deab4a11 100644
--- a/drivers/input/misc/ixp4xx-beeper.c
+++ b/drivers/input/misc/ixp4xx-beeper.c
@@ -125,7 +125,7 @@ static int ixp4xx_spkr_probe(struct platform_device *dev)
 	return 0;
 
  err_free_irq:
-	free_irq(IRQ_IXP4XX_TIMER2, dev);
+	free_irq(IRQ_IXP4XX_TIMER2, (void *)dev->id);
  err_free_device:
 	input_free_device(input_dev);
 
@@ -144,7 +144,7 @@ static int ixp4xx_spkr_remove(struct platform_device *dev)
 	disable_irq(IRQ_IXP4XX_TIMER2);
 	ixp4xx_spkr_control(pin, 0);
 
-	free_irq(IRQ_IXP4XX_TIMER2, dev);
+	free_irq(IRQ_IXP4XX_TIMER2, (void *)dev->id);
 
 	return 0;
 }
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/7] input: pmic8xxx-pwrkey: Pass correct pointer to free_irq()
  2013-05-20 14:51 [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq() Lars-Peter Clausen
                   ` (3 preceding siblings ...)
  2013-05-20 14:51 ` [PATCH 5/7] input: ixp4xx-beeper: " Lars-Peter Clausen
@ 2013-05-20 14:51 ` Lars-Peter Clausen
  2013-05-20 14:51 ` [PATCH 7/7] input: navpoint: " Lars-Peter Clausen
  2013-05-20 15:49 ` [PATCH 1/7] input: ep93xx_keypad: " H Hartley Sweeten
  6 siblings, 0 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-05-20 14:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Lars-Peter Clausen, Trilok Soni

free_irq() expects the same pointer that was passed to request_irq(), otherwise
the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

Cc: Trilok Soni <tsoni@codeaurora.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/input/misc/pmic8xxx-pwrkey.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
index afd0af9..b49b738 100644
--- a/drivers/input/misc/pmic8xxx-pwrkey.c
+++ b/drivers/input/misc/pmic8xxx-pwrkey.c
@@ -175,7 +175,7 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev)
 	return 0;
 
 free_press_irq:
-	free_irq(key_press_irq, NULL);
+	free_irq(key_press_irq, pwrkey);
 unreg_input_dev:
 	input_unregister_device(pwr);
 	pwr = NULL;
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/7] input: navpoint: Pass correct pointer to free_irq()
  2013-05-20 14:51 [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq() Lars-Peter Clausen
                   ` (4 preceding siblings ...)
  2013-05-20 14:51 ` [PATCH 6/7] input: pmic8xxx-pwrkey: " Lars-Peter Clausen
@ 2013-05-20 14:51 ` Lars-Peter Clausen
  2013-05-20 15:49 ` [PATCH 1/7] input: ep93xx_keypad: " H Hartley Sweeten
  6 siblings, 0 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-05-20 14:51 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Lars-Peter Clausen

free_irq() expects the same pointer that was passed to request_irq(), otherwise
the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/input/mouse/navpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c
index 8e1b98e..0b8d335 100644
--- a/drivers/input/mouse/navpoint.c
+++ b/drivers/input/mouse/navpoint.c
@@ -287,7 +287,7 @@ static int navpoint_probe(struct platform_device *pdev)
 	return 0;
 
 err_free_irq:
-	free_irq(ssp->irq, &pdev->dev);
+	free_irq(ssp->irq, navpoint);
 err_free_mem:
 	input_free_device(input);
 	kfree(navpoint);
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq()
  2013-05-20 14:51 [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq() Lars-Peter Clausen
                   ` (5 preceding siblings ...)
  2013-05-20 14:51 ` [PATCH 7/7] input: navpoint: " Lars-Peter Clausen
@ 2013-05-20 15:49 ` H Hartley Sweeten
  2013-05-23 16:31   ` Dmitry Torokhov
  6 siblings, 1 reply; 9+ messages in thread
From: H Hartley Sweeten @ 2013-05-20 15:49 UTC (permalink / raw)
  To: Lars-Peter Clausen, Dmitry Torokhov
  Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org

On Monday, May 20, 2013 7:51 AM, Lars-Peter Clausen wrote:
> free_irq() expects the same pointer that was passed to request_irq(), otherwise
> the IRQ is not freed.

<snip>

> Cc: H Hartley Sweeten <hartleys@visionengravers.com>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
>  drivers/input/keyboard/ep93xx_keypad.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Thanks,

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq()
  2013-05-20 15:49 ` [PATCH 1/7] input: ep93xx_keypad: " H Hartley Sweeten
@ 2013-05-23 16:31   ` Dmitry Torokhov
  0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Torokhov @ 2013-05-23 16:31 UTC (permalink / raw)
  To: H Hartley Sweeten
  Cc: Lars-Peter Clausen, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Mon, May 20, 2013 at 10:49:00AM -0500, H Hartley Sweeten wrote:
> On Monday, May 20, 2013 7:51 AM, Lars-Peter Clausen wrote:
> > free_irq() expects the same pointer that was passed to request_irq(), otherwise
> > the IRQ is not freed.
> 
> <snip>
> 
> > Cc: H Hartley Sweeten <hartleys@visionengravers.com>
> > Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> > ---
> >  drivers/input/keyboard/ep93xx_keypad.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Thanks,
> 
> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> 

Applied all, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-05-23 16:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-20 14:51 [PATCH 1/7] input: ep93xx_keypad: Pass correct pointer to free_irq() Lars-Peter Clausen
2013-05-20 14:51 ` [PATCH 2/7] input: pxa27x_keypad: " Lars-Peter Clausen
2013-05-20 14:51 ` [PATCH 3/7] input: twl4030_keypad: " Lars-Peter Clausen
2013-05-20 14:51 ` [PATCH 4/7] input: w90p910_keypad: " Lars-Peter Clausen
2013-05-20 14:51 ` [PATCH 5/7] input: ixp4xx-beeper: " Lars-Peter Clausen
2013-05-20 14:51 ` [PATCH 6/7] input: pmic8xxx-pwrkey: " Lars-Peter Clausen
2013-05-20 14:51 ` [PATCH 7/7] input: navpoint: " Lars-Peter Clausen
2013-05-20 15:49 ` [PATCH 1/7] input: ep93xx_keypad: " H Hartley Sweeten
2013-05-23 16:31   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).