Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: qcom: Fix return value check in apss_ipq6018_probe()

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>
Link: https://lore.kernel.org/r/20200628023055.50608-1-weiyongjun1@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Wei Yongjun and committed by
Stephen Boyd
dbb988b4 59390282

+2 -2
+2 -2
drivers/clk/qcom/apss-ipq6018.c
··· 87 87 struct regmap *regmap; 88 88 89 89 regmap = dev_get_regmap(pdev->dev.parent, NULL); 90 - if (IS_ERR(regmap)) 91 - return PTR_ERR(regmap); 90 + if (!regmap) 91 + return -ENODEV; 92 92 93 93 return qcom_cc_really_probe(pdev, &apss_ipq6018_desc, regmap); 94 94 }