Commit 8f4ebaaa authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

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: a7c30e62 ("net: stmmac: Add driver for Qualcomm ethqos")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Acked-by: default avatarNiklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 843ef94e
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment