summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2013-08-19 18:00:08 +0200
committerFelipe Balbi <balbi@ti.com>2013-08-27 14:17:03 -0500
commit51ef74f6400c731827454d010b35b122103fe9f9 (patch)
tree31da411ab585eadc5dcff11996d28d2eb9157457 /drivers/usb
parent272b05a9885bfe8575beac0e4fa1a1bc121f17ec (diff)
downloadblackbird-op-linux-51ef74f6400c731827454d010b35b122103fe9f9.tar.gz
blackbird-op-linux-51ef74f6400c731827454d010b35b122103fe9f9.zip
usb: musb: dsps: fix devm_ioremap_resource error detection code
devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure. Furthermore, the value returned by devm_ioremap_resource should be tested. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e,e1; statement S; @@ *e = devm_ioremap_resource(...); if (!e1) S // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb/musb_dsps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 4ffbaace7913..4ad52e76c4dd 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -361,8 +361,8 @@ static int dsps_musb_init(struct musb *musb)
return -EINVAL;
reg_base = devm_ioremap_resource(dev, r);
- if (!musb->ctrl_base)
- return -EINVAL;
+ if (IS_ERR(reg_base))
+ return PTR_ERR(reg_base);
musb->ctrl_base = reg_base;
/* NOP driver needs change if supporting dual instance */
OpenPOWER on IntegriCloud