Linux-Clk Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH -next] clk: qcom: Fix return value check in apss_ipq6018_probe()
@ 2020-06-28  2:30 Wei Yongjun
  2020-06-29 21:15 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-06-28  2:30 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Michael Turquette, Stephen Boyd,
	Sivaprakash Murugesan
  Cc: Wei Yongjun, linux-arm-msm, linux-clk, kernel-janitors, Hulk Robot

In case of error, the function dev_get_regmap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/clk/qcom/apss-ipq6018.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c
index 004f7e1ecdc2..d78ff2f310bf 100644
--- a/drivers/clk/qcom/apss-ipq6018.c
+++ b/drivers/clk/qcom/apss-ipq6018.c
@@ -87,8 +87,8 @@ static int apss_ipq6018_probe(struct platform_device *pdev)
 	struct regmap *regmap;
 
 	regmap = dev_get_regmap(pdev->dev.parent, NULL);
-	if (IS_ERR(regmap))
-		return PTR_ERR(regmap);
+	if (!regmap)
+		return -ENODEV;
 
 	return qcom_cc_really_probe(pdev, &apss_ipq6018_desc, regmap);
 }




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] clk: qcom: Fix return value check in apss_ipq6018_probe()
  2020-06-28  2:30 [PATCH -next] clk: qcom: Fix return value check in apss_ipq6018_probe() Wei Yongjun
@ 2020-06-29 21:15 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2020-06-29 21:15 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Michael Turquette,
	Sivaprakash Murugesan, Wei Yongjun
  Cc: Wei Yongjun, linux-arm-msm, linux-clk, kernel-janitors, Hulk Robot

Quoting Wei Yongjun (2020-06-27 19:30:55)
> In case of error, the function dev_get_regmap() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
> 
> Fixes: 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28  2:30 [PATCH -next] clk: qcom: Fix return value check in apss_ipq6018_probe() Wei Yongjun
2020-06-29 21:15 ` Stephen Boyd

Linux-Clk Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-clk/0 linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ https://lore.kernel.org/linux-clk \
		linux-clk@vger.kernel.org
	public-inbox-index linux-clk

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-clk


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git