diff options
author | Julia Lawall <julia@diku.dk> | 2011-01-24 14:55:22 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-01-24 20:03:43 -0500 |
commit | 28693ec01d0229b9e2a2ebe38ef8faa5e151b440 (patch) | |
tree | aba42561a1864c31615a476a3e993d08606a5fb7 /arch/arm/mach-omap2/smartreflex.c | |
parent | 1bae4ce27c9c90344f23c65ea6966c50ffeae2f5 (diff) |
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/arm/mach-omap2/smartreflex.c')
-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) | |||
966 | } | 966 | } |
967 | 967 | ||
968 | sr_info = _sr_lookup(pdata->voltdm); | 968 | sr_info = _sr_lookup(pdata->voltdm); |
969 | if (!sr_info) { | 969 | if (IS_ERR(sr_info)) { |
970 | dev_warn(&pdev->dev, "%s: omap_sr struct not found\n", | 970 | dev_warn(&pdev->dev, "%s: omap_sr struct not found\n", |
971 | __func__); | 971 | __func__); |
972 | return -EINVAL; | 972 | return -EINVAL; |