Skip to content

Commit bd449ad

Browse files
Yang Yinglianggregkh
authored andcommitted
usb: musb: fix error return code in omap2430_probe()
Before calling platform_get_resource() in omap2430_probe(), the 'ret' is re-assgined to 0, it can't return an error code, if platform_get_resource fails. Set the error code to -EINVAL to fix this. Fixes: ffbe2fe ("usb: musb: omap2430: Fix probe regression for missing resources") Cc: stable <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f96c038 commit bd449ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/musb/omap2430.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,10 @@ static int omap2430_probe(struct platform_device *pdev)
411411
memset(musb_res, 0, sizeof(*musb_res) * ARRAY_SIZE(musb_res));
412412

413413
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
414-
if (!res)
414+
if (!res) {
415+
ret = -EINVAL;
415416
goto err2;
417+
}
416418

417419
musb_res[i].start = res->start;
418420
musb_res[i].end = res->end;

0 commit comments

Comments
 (0)