* [PATCH] nfp: fix error return code in nfp_net_netdev_open()
@ 2016-09-15 3:45 Wei Yongjun
2016-09-15 7:43 ` Jakub Kicinski
2016-09-16 8:27 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2016-09-15 3:45 UTC (permalink / raw)
To: Jakub Kicinski, Rolf Neugebauer, Dinan Gunawardena, Simon Horman
Cc: Wei Yongjun, oss-drivers, 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: 73725d9dfd99 ("nfp: allocate ring SW structs dynamically")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 252e492..39dadfc 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -2044,12 +2044,16 @@ static int nfp_net_netdev_open(struct net_device *netdev)
nn->rx_rings = kcalloc(nn->num_rx_rings, sizeof(*nn->rx_rings),
GFP_KERNEL);
- if (!nn->rx_rings)
+ if (!nn->rx_rings) {
+ err = -ENOMEM;
goto err_free_lsc;
+ }
nn->tx_rings = kcalloc(nn->num_tx_rings, sizeof(*nn->tx_rings),
GFP_KERNEL);
- if (!nn->tx_rings)
+ if (!nn->tx_rings) {
+ err = -ENOMEM;
goto err_free_rx_rings;
+ }
for (r = 0; r < nn->num_r_vecs; r++) {
err = nfp_net_prepare_vector(nn, &nn->r_vecs[r], r);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nfp: fix error return code in nfp_net_netdev_open()
2016-09-15 3:45 [PATCH] nfp: fix error return code in nfp_net_netdev_open() Wei Yongjun
@ 2016-09-15 7:43 ` Jakub Kicinski
2016-09-16 8:27 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2016-09-15 7:43 UTC (permalink / raw)
To: Wei Yongjun
Cc: Dinan Gunawardena, Simon Horman, Wei Yongjun, oss-drivers, netdev
On Thu, 15 Sep 2016 03:45:07 +0000, Wei Yongjun wrote:
> 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: 73725d9dfd99 ("nfp: allocate ring SW structs dynamically")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
FWIW this is for net. Thanks Wei!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nfp: fix error return code in nfp_net_netdev_open()
2016-09-15 3:45 [PATCH] nfp: fix error return code in nfp_net_netdev_open() Wei Yongjun
2016-09-15 7:43 ` Jakub Kicinski
@ 2016-09-16 8:27 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-09-16 8:27 UTC (permalink / raw)
To: weiyj.lk
Cc: jakub.kicinski, rolf.neugebauer, dinan.gunawardena, simon.horman,
weiyongjun1, oss-drivers, netdev
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Thu, 15 Sep 2016 03:45:07 +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: 73725d9dfd99 ("nfp: allocate ring SW structs dynamically")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-16 8:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-15 3:45 [PATCH] nfp: fix error return code in nfp_net_netdev_open() Wei Yongjun
2016-09-15 7:43 ` Jakub Kicinski
2016-09-16 8:27 ` 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).