Commit 4774db8d authored by Peng Wu's avatar Peng Wu Committed by Jakub Kicinski

net/mlxbf_gige: Fix an IS_ERR() vs NULL bug in mlxbf_gige_mdio_probe

The devm_ioremap() function returns NULL on error, it doesn't return
error pointers.

Fixes: 3a1a274e ("mlxbf_gige: compute MDIO period based on i1clk")
Signed-off-by: default avatarPeng Wu <wupeng58@huawei.com>
Link: https://lore.kernel.org/r/20220923023640.116057-1-wupeng58@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c635ebe8
...@@ -246,8 +246,8 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) ...@@ -246,8 +246,8 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv)
} }
priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); priv->clk_io = devm_ioremap(dev, res->start, resource_size(res));
if (IS_ERR(priv->clk_io)) if (!priv->clk_io)
return PTR_ERR(priv->clk_io); return -ENOMEM;
mlxbf_gige_mdio_cfg(priv); mlxbf_gige_mdio_cfg(priv);
......
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