[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220620083423.35794-1-zhangjian210@huawei.com>
Date: Mon, 20 Jun 2022 08:34:23 +0000
From: Jian Zhang <zhangjian210@...wei.com>
To: <mirela.rabulea@....com>, <mchehab@...nel.org>,
<shawnguo@...nel.org>, <s.hauer@...gutronix.de>,
<linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <xuqiang36@...wei.com>
Subject: [-next] driver/nxp/imx-jpeg: fix a unexpected return value problem
In function mxc_jpeg_probe(), when devm_clk_get() fail, the return value
will be unexpected, and it should be the devm_clk_get's error code.
Fixes: 4c2e5156d9fa6 ("media: imx-jpeg: Add pm-runtime support for imx-jpeg")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Jian Zhang <zhangjian210@...wei.com>
---
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
index 965021d3c7ef..cad6bf03236f 100644
--- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
@@ -2211,12 +2211,14 @@ static int mxc_jpeg_probe(struct platform_device *pdev)
jpeg->clk_ipg = devm_clk_get(dev, "ipg");
if (IS_ERR(jpeg->clk_ipg)) {
dev_err(dev, "failed to get clock: ipg\n");
+ ret = PTR_ERR(jpeg->clk_ipg);
goto err_clk;
}
jpeg->clk_per = devm_clk_get(dev, "per");
if (IS_ERR(jpeg->clk_per)) {
dev_err(dev, "failed to get clock: per\n");
+ ret = PTR_ERR(jpeg->clk_per);
goto err_clk;
}
--
2.17.1
Powered by blists - more mailing lists