net/mlxbf_gige: Fix an IS_ERR() vs NULL bug in mlxbf_gige_mdio_probe
Subsystems (2)
PATCH 1/1 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 3a1a274e933f ("mlxbf_gige: compute MDIO period based on i1clk")
Signed-off-by Peng Wu <[email protected]>
--- drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c +2 -2
@@ -240,8 +240,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)); -if (IS_ERR (priv->clk_io)) -return PTR_ERR (priv->clk_io); +if (!priv->clk_io) +return -ENOMEM ;mlxbf_gige_mdio_cfg (priv);
Signature · 1 line
2.17.1
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Fri, 23 Sep 2022 02:36:40 +0000 you wrote:
The
devm_ioremap()function returns NULL on error, it doesn't return error pointers.Fixes 3a1a274e933f ("mlxbf_gige: compute MDIO period based on i1clk")Signed-off-by Peng Wu <[email protected]>--- drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Here is the summary with links:
- net/mlxbf_gige: Fix an IS_ERR() vs NULL bug in mlxbf_gige_mdio_probe
https://git.kernel.org/netdev/net/c/4774db8dfc6a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html