summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-10-17 15:19:56 +0000
committerDavid S. Miller <davem@davemloft.net>2016-10-17 13:16:52 -0400
commit3f3177bb680fc08300e6f2341f44755ff90a358a (patch)
treee69a59795438a05ccca8fd77549a3474801b3c86 /drivers/net/ethernet/freescale
parenta0e65de71527477b100afe1e9ab2667d70f94d9e (diff)
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: 3933961682a3 ("fsl/fman: Add FMan MAC driver") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/fman/mac.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index 8fe6b3e253fa..cc5d07cfe535 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -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;