Skip to content

Commit 3f3177b

Browse files
Wei Yongjundavem330
authored andcommitted
fsl/fman: fix error return code in mac_probe()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 3933961 ("fsl/fman: Add FMan MAC driver") Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a0e65de commit 3f3177b

File tree

1 file changed

+6
-2
lines changed
  • drivers/net/ethernet/freescale/fman

1 file changed

+6
-2
lines changed

drivers/net/ethernet/freescale/fman/mac.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,13 +879,17 @@ static int mac_probe(struct platform_device *_of_dev)
879879

880880
priv->fixed_link = kzalloc(sizeof(*priv->fixed_link),
881881
GFP_KERNEL);
882-
if (!priv->fixed_link)
882+
if (!priv->fixed_link) {
883+
err = -ENOMEM;
883884
goto _return_dev_set_drvdata;
885+
}
884886

885887
priv->phy_node = of_node_get(mac_node);
886888
phy = of_phy_find_device(priv->phy_node);
887-
if (!phy)
889+
if (!phy) {
890+
err = -EINVAL;
888891
goto _return_dev_set_drvdata;
892+
}
889893

890894
priv->fixed_link->link = phy->link;
891895
priv->fixed_link->speed = phy->speed;

0 commit comments

Comments
 (0)