提交 21cdd6a0 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

usb: musb: mpfs: Fix error codes in probe()

These error paths return success but they need to return a negative
error code.

Fixes: 7a96b6ea ("usb: musb: Add support for PolarFire SoC's musb controller")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YrVmLEc/FOEzNdzj@kiliSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 105f3fd2
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册