Skip to content

Commit 21cdd6a

Browse files
Dan Carpentergregkh
authored andcommitted
usb: musb: mpfs: Fix error codes in probe()
These error paths return success but they need to return a negative error code. Fixes: 7a96b6e ("usb: musb: Add support for PolarFire SoC's musb controller") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/YrVmLEc/FOEzNdzj@kili Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 105f3fd commit 21cdd6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/usb/musb/mpfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ static int mpfs_probe(struct platform_device *pdev)
181181
glue->clk = clk;
182182

183183
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
184-
if (!pdata)
184+
if (!pdata) {
185+
ret = -ENOMEM;
185186
goto err_clk_disable;
187+
}
186188

187189
pdata->config = &mpfs_musb_hdrc_config;
188190
pdata->platform_ops = &mpfs_ops;
@@ -197,6 +199,7 @@ static int mpfs_probe(struct platform_device *pdev)
197199
if (IS_ERR(glue->phy)) {
198200
dev_err(dev, "failed to register usb-phy %ld\n",
199201
PTR_ERR(glue->phy));
202+
ret = PTR_ERR(glue->phy);
200203
goto err_clk_disable;
201204
}
202205

0 commit comments

Comments
 (0)