Commit 3f3177bb authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

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: 39339616 ("fsl/fman: Add FMan MAC driver")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0e65de7
...@@ -879,13 +879,17 @@ static int mac_probe(struct platform_device *_of_dev) ...@@ -879,13 +879,17 @@ static int mac_probe(struct platform_device *_of_dev)
priv->fixed_link = kzalloc(sizeof(*priv->fixed_link), priv->fixed_link = kzalloc(sizeof(*priv->fixed_link),
GFP_KERNEL); GFP_KERNEL);
if (!priv->fixed_link) if (!priv->fixed_link) {
err = -ENOMEM;
goto _return_dev_set_drvdata; goto _return_dev_set_drvdata;
}
priv->phy_node = of_node_get(mac_node); priv->phy_node = of_node_get(mac_node);
phy = of_phy_find_device(priv->phy_node); phy = of_phy_find_device(priv->phy_node);
if (!phy) if (!phy) {
err = -EINVAL;
goto _return_dev_set_drvdata; goto _return_dev_set_drvdata;
}
priv->fixed_link->link = phy->link; priv->fixed_link->link = phy->link;
priv->fixed_link->speed = phy->speed; priv->fixed_link->speed = phy->speed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment