Skip to content

Commit

Permalink
fsl/fman: fix error return code in mac_probe()
Browse files Browse the repository at this point in the history
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 <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Oct 17, 2016
1 parent a0e65de commit 3f3177b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/ethernet/freescale/fman/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,13 +879,17 @@ static int mac_probe(struct platform_device *_of_dev)

priv->fixed_link = kzalloc(sizeof(*priv->fixed_link),
GFP_KERNEL);
if (!priv->fixed_link)
if (!priv->fixed_link) {
err = -ENOMEM;
goto _return_dev_set_drvdata;
}

priv->phy_node = of_node_get(mac_node);
phy = of_phy_find_device(priv->phy_node);
if (!phy)
if (!phy) {
err = -EINVAL;
goto _return_dev_set_drvdata;
}

priv->fixed_link->link = phy->link;
priv->fixed_link->speed = phy->speed;
Expand Down

0 comments on commit 3f3177b

Please sign in to comment.