* [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference
@ 2010-05-27 12:32 ` Julia Lawall
0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2010-05-27 12:32 UTC (permalink / raw)
To: Mark Brown, Wim Van Sebroeck, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
At the point of the call to dev_err, wm8350 is NULL.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@
if ((E = NULL && ...) || ...)
{
... when != if (...) S1 else S2
when != E = E1
* E->f
... when any
return ...;
}
else S3
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/watchdog/wm8350_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c
index 89dd7b0..b68d928 100644
--- a/drivers/watchdog/wm8350_wdt.c
+++ b/drivers/watchdog/wm8350_wdt.c
@@ -284,7 +284,7 @@ static int __devinit wm8350_wdt_probe(struct platform_device *pdev)
struct wm8350 *wm8350 = platform_get_drvdata(pdev);
if (!wm8350) {
- dev_err(wm8350->dev, "No driver data supplied\n");
+ pr_err("No driver data supplied\n");
return -ENODEV;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference
@ 2010-05-27 12:32 ` Julia Lawall
0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2010-05-27 12:32 UTC (permalink / raw)
To: Mark Brown, Wim Van Sebroeck, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
At the point of the call to dev_err, wm8350 is NULL.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@
if ((E == NULL && ...) || ...)
{
... when != if (...) S1 else S2
when != E = E1
* E->f
... when any
return ...;
}
else S3
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/watchdog/wm8350_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c
index 89dd7b0..b68d928 100644
--- a/drivers/watchdog/wm8350_wdt.c
+++ b/drivers/watchdog/wm8350_wdt.c
@@ -284,7 +284,7 @@ static int __devinit wm8350_wdt_probe(struct platform_device *pdev)
struct wm8350 *wm8350 = platform_get_drvdata(pdev);
if (!wm8350) {
- dev_err(wm8350->dev, "No driver data supplied\n");
+ pr_err("No driver data supplied\n");
return -ENODEV;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer
2010-05-27 12:32 ` Julia Lawall
@ 2010-05-31 11:23 ` Mark Brown
-1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2010-05-31 11:23 UTC (permalink / raw)
To: Julia Lawall; +Cc: Wim Van Sebroeck, linux-kernel, kernel-janitors
On Thu, May 27, 2010 at 02:32:24PM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> At the point of the call to dev_err, wm8350 is NULL.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference
@ 2010-05-31 11:23 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2010-05-31 11:23 UTC (permalink / raw)
To: Julia Lawall; +Cc: Wim Van Sebroeck, linux-kernel, kernel-janitors
On Thu, May 27, 2010 at 02:32:24PM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> At the point of the call to dev_err, wm8350 is NULL.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer
2010-05-31 11:23 ` [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference Mark Brown
@ 2010-05-31 11:39 ` Wim Van Sebroeck
-1 siblings, 0 replies; 6+ messages in thread
From: Wim Van Sebroeck @ 2010-05-31 11:39 UTC (permalink / raw)
To: Mark Brown, Julia Lawall; +Cc: linux-kernel, kernel-janitors
Hi All,
> > From: Julia Lawall <julia@diku.dk>
> >
> > At the point of the call to dev_err, wm8350 is NULL.
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Will add this one in linux-2.6-watchdog-next for testing and sent it to Linus after a couple of days.
Kind regards,
Wim.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference
@ 2010-05-31 11:39 ` Wim Van Sebroeck
0 siblings, 0 replies; 6+ messages in thread
From: Wim Van Sebroeck @ 2010-05-31 11:39 UTC (permalink / raw)
To: Mark Brown, Julia Lawall; +Cc: linux-kernel, kernel-janitors
Hi All,
> > From: Julia Lawall <julia@diku.dk>
> >
> > At the point of the call to dev_err, wm8350 is NULL.
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Will add this one in linux-2.6-watchdog-next for testing and sent it to Linus after a couple of days.
Kind regards,
Wim.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-05-31 11:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27 12:32 [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference Julia Lawall
2010-05-27 12:32 ` Julia Lawall
2010-05-31 11:23 ` [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer Mark Brown
2010-05-31 11:23 ` [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference Mark Brown
2010-05-31 11:39 ` [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer Wim Van Sebroeck
2010-05-31 11:39 ` [PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference Wim Van Sebroeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.