diff options
author | Julia Lawall <julia@diku.dk> | 2011-01-24 20:55:22 +0100 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-01-25 02:03:43 +0100 |
commit | 28693ec01d0229b9e2a2ebe38ef8faa5e151b440 (patch) | |
tree | aba42561a1864c31615a476a3e993d08606a5fb7 /arch | |
parent | Linux 2.6.38-rc2 (diff) | |
download | linux-28693ec01d0229b9e2a2ebe38ef8faa5e151b440.tar.xz linux-28693ec01d0229b9e2a2ebe38ef8faa5e151b440.zip |
OMAP: PM: SmartReflex: Add missing IS_ERR test
Function _sr_lookup, defined in the same file, returns ERR_PTR not NULL in
an error case.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
identifier f;
@@
f(...) { ... return ERR_PTR(...); }
@@
identifier r.f, fld;
expression x;
statement S1,S2;
@@
x = f(...)
... when != IS_ERR(x)
(
if (IS_ERR(x) ||...) S1 else S2
|
*x->fld
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 77ecebf3fae2..d7deadfaddbc 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -966,7 +966,7 @@ static int __devexit omap_sr_remove(struct platform_device *pdev) } sr_info = _sr_lookup(pdata->voltdm); - if (!sr_info) { + if (IS_ERR(sr_info)) { dev_warn(&pdev->dev, "%s: omap_sr struct not found\n", __func__); return -EINVAL; |