Skip to content

Commit 4774db8

Browse files
Peng Wukuba-moo
authored andcommitted
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: 3a1a274 ("mlxbf_gige: compute MDIO period based on i1clk") Signed-off-by: Peng Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c635ebe commit 4774db8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv)
246246
}
247247

248248
priv->clk_io = devm_ioremap(dev, res->start, resource_size(res));
249-
if (IS_ERR(priv->clk_io))
250-
return PTR_ERR(priv->clk_io);
249+
if (!priv->clk_io)
250+
return -ENOMEM;
251251

252252
mlxbf_gige_mdio_cfg(priv);
253253

0 commit comments

Comments
 (0)