Thread (11 messages) 11 messages, 4 authors, 2010-10-04
STALE5736d

RE: [PATCH v2] OMAP3: Keypad: Fix failure exit path in probe

From: G, Manjunath Kondaiah <hidden>
Date: 2010-10-04 08:02:29
Also in: linux-arm-kernel, linux-omap

Dmitry,
As agreed, can you push this patch?
https://patchwork.kernel.org/patch/197442/

-Manjunath
quoted hunk ↗ jump to hunk
-----Original Message-----
From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] 
Sent: Tuesday, September 21, 2010 9:57 PM
To: G, Manjunath Kondaiah
Cc: Ameya Palande; linux-omap@vger.kernel.org; 
linux-input@vger.kernel.org; 
linux-arm-kernel@lists.infradead.org; Tony Lindgren
Subject: Re: [PATCH v2] OMAP3: Keypad: Fix failure exit path in probe

Hi,

On Tue, Sep 21, 2010 at 07:11:01PM +0530, G, Manjunath Kondaiah wrote:
quoted
Hi,
quoted
-----Original Message-----
From: Ameya Palande [mailto:ameya.palande@nokia.com]
Sent: Tuesday, September 21, 2010 7:04 PM
To: G, Manjunath Kondaiah
Cc: linux-omap@vger.kernel.org; 
linux-input@vger.kernel.org; Dmitry 
quoted
quoted
Torokhov; linux-arm-kernel@lists.infradead.org; Tony Lindgren
Subject: Re: [PATCH v2] OMAP3: Keypad: Fix failure exit path in 
probe

Hi Manjunath,

On Tue, 2010-09-21 at 13:49 +0200, ext G, Manjunath 
Kondaiah wrote:
quoted
quoted
quoted
The failure exit paths seems to be wrong in probe function.
This patch corrects exit failure paths for error handling cases.
And also adds memory leak...

quoted
quoted
https://patchwork.kernel.org/patch/160551/
Any comments on this?
Looks fine. Sorry, I didn't look at the change. This 
version seems to 
quoted
be better.
I do not understand why we need to separate memory 
allocations. It looks
like the minimal patch should be like one below.

Thanks.

-- 
Dmitry


Input: twl4030_keypad - fix error handling path

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

We should not try to call free_irq() when request_irq() failed.

Reported-by: G, Manjunath Kondaiah <redacted>
Signed-off-by: Dmitry Torokhov <redacted>
---

 drivers/input/keyboard/twl4030_keypad.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/twl4030_keypad.c 
b/drivers/input/keyboard/twl4030_keypad.c
index fb16b5e..09bef79 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)
 	if (error) {
 		dev_info(kp->dbg_dev, "request_irq failed for 
irq no=%d\n",
 			kp->irq);
-		goto err3;
+		goto err2;
 	}
 
 	/* Enable KP and TO interrupts now. */
 	reg = (u8) ~(KEYP_IMR1_KP | KEYP_IMR1_TO);
 	if (twl4030_kpwrite_u8(kp, reg, KEYP_IMR1)) {
 		error = -EIO;
-		goto err4;
+		goto err3;
 	}
 
 	platform_set_drvdata(pdev, kp);
 	return 0;
 
-err4:
+err3:
 	/* mask all events - we don't care about the result */
 	(void) twl4030_kpwrite_u8(kp, 0xff, KEYP_IMR1);
-err3:
 	free_irq(kp->irq, NULL);
 err2:
 	input_unregister_device(input);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help