usb: musb: fix error return code in omap2430_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 30 Dec 2022 08:17:30 +0000 (16:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:24:38 +0000 (07:24 +0100)
commit421492f229f027840a7c468b10229e17d36ad653
tree508db87751b6bf6504383c420298a05b63882168
parentb3fdc02c61234860af03640182474c72a9768666
usb: musb: fix error return code in omap2430_probe()

commit bd449ad8cee9d4b523abbdfa73e1a2a08333f331 upstream.

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: ffbe2feac59b ("usb: musb: omap2430: Fix probe regression for missing resources")
Cc: stable <stable@kernel.org>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221230081730.1655616-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/omap2430.c