summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-06-24 10:22:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-24 13:36:47 +0200
commit21cdd6a0e8441461e549f0c25af9696c6c4de22c (patch)
tree925b44035323bb130a277e8f8dbf3edf6a936bbc /drivers/usb/musb
parent105f3fd2f789e001ba449d4020e168ea2b5b64aa (diff)
downloadlinux-stable-21cdd6a0e8441461e549f0c25af9696c6c4de22c.tar.gz
linux-stable-21cdd6a0e8441461e549f0c25af9696c6c4de22c.tar.bz2
linux-stable-21cdd6a0e8441461e549f0c25af9696c6c4de22c.zip
usb: musb: mpfs: Fix error codes in probe()
These error paths return success but they need to return a negative error code. Fixes: 7a96b6ea90a4 ("usb: musb: Add support for PolarFire SoC's musb controller") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YrVmLEc/FOEzNdzj@kili Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/mpfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/musb/mpfs.c b/drivers/usb/musb/mpfs.c
index 99666ef8af06..a69ca338eace 100644
--- a/drivers/usb/musb/mpfs.c
+++ b/drivers/usb/musb/mpfs.c
@@ -181,8 +181,10 @@ static int mpfs_probe(struct platform_device *pdev)
glue->clk = clk;
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
- if (!pdata)
+ if (!pdata) {
+ ret = -ENOMEM;
goto err_clk_disable;
+ }
pdata->config = &mpfs_musb_hdrc_config;
pdata->platform_ops = &mpfs_ops;
@@ -197,6 +199,7 @@ static int mpfs_probe(struct platform_device *pdev)
if (IS_ERR(glue->phy)) {
dev_err(dev, "failed to register usb-phy %ld\n",
PTR_ERR(glue->phy));
+ ret = PTR_ERR(glue->phy);
goto err_clk_disable;
}