aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-01-23 06:19:18 +0000
committerVinod Koul <vkoul@kernel.org>2019-02-26 00:06:36 +0530
commit4ffe3fcbcb81e36a93a7f9981d6aeee2a3c222c7 (patch)
treef08a849f3c93433edb5ae47eeb9ae15ab8e2d24e
parent2a0c825e4267e3b09863b5611b7479bb9568be44 (diff)
FROMGIT: net: stmmac: Fix return value check in qcom_ethqos_probe()
In case of error, the function devm_clk_get() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Vinod Koul <vkoul@kernel.org> Acked-by: Niklas Cassel <niklas.cassel@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 8f4ebaaa8d97dc531a3f947a8d30a5a70fe38743 https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git) Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 30724bd330f4..7ec895407d23 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -473,8 +473,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
ethqos->por = of_device_get_match_data(&pdev->dev);
ethqos->rgmii_clk = devm_clk_get(&pdev->dev, "rgmii");
- if (!ethqos->rgmii_clk) {
- ret = -ENOMEM;
+ if (IS_ERR(ethqos->rgmii_clk)) {
+ ret = PTR_ERR(ethqos->rgmii_clk);
goto err_mem;
}