mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
272b05a988
commit
51ef74f640
1 changed files with 2 additions and 2 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue