* [PATCH -next] fsl/fman: fix error return code in mac_probe()
@ 2016-10-17 15:19 Wei Yongjun
2016-10-17 17:17 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2016-10-17 15:19 UTC (permalink / raw)
To: Madalin Bucur; +Cc: Wei Yongjun, netdev
From: Wei Yongjun <weiyongjun1@huawei.com>
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>
---
drivers/net/ethernet/freescale/fman/mac.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index 8fe6b3e..cc5d07c 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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] fsl/fman: fix error return code in mac_probe()
2016-10-17 15:19 [PATCH -next] fsl/fman: fix error return code in mac_probe() Wei Yongjun
@ 2016-10-17 17:17 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-10-17 17:17 UTC (permalink / raw)
To: weiyj.lk; +Cc: madalin.bucur, weiyongjun1, netdev
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Mon, 17 Oct 2016 15:19:56 +0000
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-17 17:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-17 15:19 [PATCH -next] fsl/fman: fix error return code in mac_probe() Wei Yongjun
2016-10-17 17:17 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).