2017-11-18 00:17:45

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 00/10] Handle platform_get_irq's error checking and returns

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct and we must check its return value.

Arvind Yadav (10):
[PATCH 01/10] Input: ep93xx_keypad: Fix platform_get_irq's error checking
[PATCH 02/10] Input: omap4-keypad: Fix platform_get_irq's error checking
[PATCH 03/10] Input: twl4030_keypad: Fix platform_get_irq's error checking
[PATCH 04/10] Input: serio: Fix platform_get_irq's error checking
[PATCH 05/10] Input: cpcap-pwrbutton: Handle return value of platform_get_irq
[PATCH 06/10] Input: w90p910_ts: Handle return value of platform_get_irq
[PATCH 07/10] Input: sun4i-ts: Handle return value of platform_get_irq
[PATCH 08/10] Input: twl4030-pwrbutton: Handle return value of platform_get_irq
[PATCH 09/10] Input: sirfsoc-onkey: Handle return value of platform_get_irq
[PATCH 10/10] Input: palmas-pwrbutton: Handle return value of platform_get_irq

drivers/input/keyboard/ep93xx_keypad.c | 2 +-
drivers/input/keyboard/omap4-keypad.c | 2 +-
drivers/input/keyboard/twl4030_keypad.c | 2 +-
drivers/input/misc/cpcap-pwrbutton.c | 3 +++
drivers/input/misc/palmas-pwrbutton.c | 5 +++++
drivers/input/misc/sirfsoc-onkey.c | 3 +++
drivers/input/misc/twl4030-pwrbutton.c | 3 +++
drivers/input/serio/sun4i-ps2.c | 2 +-
drivers/input/touchscreen/sun4i-ts.c | 3 +++
drivers/input/touchscreen/w90p910_ts.c | 4 ++++
10 files changed, 25 insertions(+), 4 deletions(-)

--
2.7.4


From 1586674965838387786@xxx Wed Dec 13 13:19:23 +0000 2017
X-GM-THRID: 1586484335826433230
X-Gmail-Labels: Inbox,Category Forums


2017-11-18 00:21:09

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 09/10] Input: sirfsoc-onkey: Handle return value of platform_get_irq

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/input/misc/sirfsoc-onkey.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c
index 4fd038d..de04b48 100644
--- a/drivers/input/misc/sirfsoc-onkey.c
+++ b/drivers/input/misc/sirfsoc-onkey.c
@@ -149,6 +149,9 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev)
sirfsoc_pwrc_toggle_interrupts(pwrcdrv, false);

irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
error = devm_request_irq(&pdev->dev, irq,
sirfsoc_pwrc_isr, 0,
"sirfsoc_pwrc_int", pwrcdrv);
--
2.7.4


From 1584367482866995210@xxx Sat Nov 18 02:02:56 +0000 2017
X-GM-THRID: 1584367482866995210
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-18 04:41:53

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 07/10] Input: sun4i-ts: Handle return value of platform_get_irq

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/input/touchscreen/sun4i-ts.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
index d2e14d9..2753fd3 100644
--- a/drivers/input/touchscreen/sun4i-ts.c
+++ b/drivers/input/touchscreen/sun4i-ts.c
@@ -315,6 +315,9 @@ static int sun4i_ts_probe(struct platform_device *pdev)
return PTR_ERR(ts->base);

ts->irq = platform_get_irq(pdev, 0);
+ if (ts->irq < 0)
+ return ts->irq;
+
error = devm_request_irq(dev, ts->irq, sun4i_ts_irq, 0, "sun4i-ts", ts);
if (error)
return error;
--
2.7.4


From 1583694173340911643@xxx Fri Nov 10 15:40:58 +0000 2017
X-GM-THRID: 1583694173340911643
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-18 02:34:08

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 02/10] Input: omap4-keypad: Fix platform_get_irq's error checking

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/input/keyboard/omap4-keypad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 940d38b..8a4b161 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -251,7 +251,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
}

irq = platform_get_irq(pdev, 0);
- if (!irq) {
+ if (irq < 0) {
dev_err(&pdev->dev, "no keyboard irq assigned\n");
return -EINVAL;
}
--
2.7.4


From 1583407640775399255@xxx Tue Nov 07 11:46:39 +0000 2017
X-GM-THRID: 1583057850648089176
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread