public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277)
@ 2012-09-12  3:11 Fengguang Wu
  2012-09-12  5:19 ` [PATCH] gpio: pcf857x: fixup smatch WARNING Kuninori Morimoto
  2012-09-12  6:09 ` pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277) Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Fengguang Wu @ 2012-09-12  3:11 UTC (permalink / raw)
  To: kernel-janitors

FYI, there are new smatch warnings on

commit 6e20a0a429bd4dc07d6de16d9c247270e04e4aa0 gpio: pcf857x: enable gpio_to_irq() support

drivers/gpio/gpio-pcf857x.c:288 pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277)
drivers/gpio/gpio-pcf857x.c:364 pcf857x_probe() warn: variable dereferenced before check 'pdata' (see line 292)
drivers/gpio/gpio-pcf857x.c:421 pcf857x_remove() error: we previously assumed 'pdata' could be null (see line 410)

---
0-DAY kernel build testing backend         Open Source Technology Centre
Fengguang Wu <wfg@linux.intel.com>                     Intel Corporation

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

* [PATCH] gpio: pcf857x: fixup smatch WARNING
  2012-09-12  3:11 pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277) Fengguang Wu
@ 2012-09-12  5:19 ` Kuninori Morimoto
  2012-09-12  6:10   ` Linus Walleij
  2012-09-12 15:45   ` Linus Walleij
  2012-09-12  6:09 ` pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277) Linus Walleij
  1 sibling, 2 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2012-09-12  5:19 UTC (permalink / raw)
  To: Linus Walleij, Fengguang Wu; +Cc: kernel-janitors, linux-kernel

6e20a0a429bd4dc07d6de16d9c247270e04e4aa0
(gpio: pcf857x: enable gpio_to_irq() support)
added new smatch warnings

drivers/gpio/gpio-pcf857x.c:288 pcf857x_probe() error: we previously \
	assumed 'pdata' could be null (see line 277)
drivers/gpio/gpio-pcf857x.c:364 pcf857x_probe() warn: variable dereferenced\
	 before check 'pdata' (see line 292)
drivers/gpio/gpio-pcf857x.c:421 pcf857x_remove() error: we previously\
	 assumed 'pdata' could be null (see line 410)

This patch fixes it

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/gpio/gpio-pcf857x.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c
index 12e3e48..16af35c 100644
--- a/drivers/gpio/gpio-pcf857x.c
+++ b/drivers/gpio/gpio-pcf857x.c
@@ -285,7 +285,7 @@ static int pcf857x_probe(struct i2c_client *client,
 	gpio->chip.ngpio		= id->driver_data;
 
 	/* enable gpio_to_irq() if platform has settings */
-	if (pdata->irq) {
+	if (pdata && pdata->irq) {
 		status = pcf857x_irq_domain_init(gpio, pdata, &client->dev);
 		if (status < 0) {
 			dev_err(&client->dev, "irq_domain init failed\n");
@@ -394,7 +394,7 @@ fail:
 	dev_dbg(&client->dev, "probe error %d for '%s'\n",
 			status, client->name);
 
-	if (pdata->irq)
+	if (pdata && pdata->irq)
 		pcf857x_irq_domain_cleanup(gpio);
 
 	kfree(gpio);
@@ -418,7 +418,7 @@ static int pcf857x_remove(struct i2c_client *client)
 		}
 	}
 
-	if (pdata->irq)
+	if (pdata && pdata->irq)
 		pcf857x_irq_domain_cleanup(gpio);
 
 	status = gpiochip_remove(&gpio->chip);
-- 
1.7.9.5


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

* Re: pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277)
  2012-09-12  3:11 pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277) Fengguang Wu
  2012-09-12  5:19 ` [PATCH] gpio: pcf857x: fixup smatch WARNING Kuninori Morimoto
@ 2012-09-12  6:09 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2012-09-12  6:09 UTC (permalink / raw)
  To: kernel-janitors

On Wed, Sep 12, 2012 at 5:11 AM, Fengguang Wu <fengguang.wu@intel.com> wrote:

> FYI, there are new smatch warnings on
>
> commit 6e20a0a429bd4dc07d6de16d9c247270e04e4aa0 gpio: pcf857x: enable gpio_to_irq() support
>
> drivers/gpio/gpio-pcf857x.c:288 pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277)
> drivers/gpio/gpio-pcf857x.c:364 pcf857x_probe() warn: variable dereferenced before check 'pdata' (see line 292)
> drivers/gpio/gpio-pcf857x.c:421 pcf857x_remove() error: we previously assumed 'pdata' could be null (see line 410)

OK Kuninoiri can you have a look at this and see if you can
fix it up?

Yours,
Linus Walleij

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

* Re: [PATCH] gpio: pcf857x: fixup smatch WARNING
  2012-09-12  5:19 ` [PATCH] gpio: pcf857x: fixup smatch WARNING Kuninori Morimoto
@ 2012-09-12  6:10   ` Linus Walleij
  2012-09-12 15:45   ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2012-09-12  6:10 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Fengguang Wu, kernel-janitors, linux-kernel

On Wed, Sep 12, 2012 at 7:19 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:

> This patch fixes it
>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Hey you fix things quicker than I can read my mail :-) :-)

Thanks!

Yours,
Linus Walleij

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

* Re: [PATCH] gpio: pcf857x: fixup smatch WARNING
  2012-09-12  5:19 ` [PATCH] gpio: pcf857x: fixup smatch WARNING Kuninori Morimoto
  2012-09-12  6:10   ` Linus Walleij
@ 2012-09-12 15:45   ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2012-09-12 15:45 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Fengguang Wu, kernel-janitors, linux-kernel

On Wed, Sep 12, 2012 at 7:19 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:

> 6e20a0a429bd4dc07d6de16d9c247270e04e4aa0
> (gpio: pcf857x: enable gpio_to_irq() support)
> added new smatch warnings
>
> drivers/gpio/gpio-pcf857x.c:288 pcf857x_probe() error: we previously \
>         assumed 'pdata' could be null (see line 277)
> drivers/gpio/gpio-pcf857x.c:364 pcf857x_probe() warn: variable dereferenced\
>          before check 'pdata' (see line 292)
> drivers/gpio/gpio-pcf857x.c:421 pcf857x_remove() error: we previously\
>          assumed 'pdata' could be null (see line 410)
>
> This patch fixes it
>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Applied, thanks!
Linus Walleij

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

end of thread, other threads:[~2012-09-12 15:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-12  3:11 pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277) Fengguang Wu
2012-09-12  5:19 ` [PATCH] gpio: pcf857x: fixup smatch WARNING Kuninori Morimoto
2012-09-12  6:10   ` Linus Walleij
2012-09-12 15:45   ` Linus Walleij
2012-09-12  6:09 ` pcf857x_probe() error: we previously assumed 'pdata' could be null (see line 277) Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox