netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] gve: Fix error return code in gve_alloc_qpls()
@ 2019-07-05  1:16 Wei Yongjun
  2019-07-08  2:35 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2019-07-05  1:16 UTC (permalink / raw)
  To: Catherine Sullivan, Sagi Shahar, Jon Olson, Colin Ian King,
	Willem de Bruijn, Luigi Rizzo
  Cc: Wei Yongjun, netdev, kernel-janitors

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: f5cedc84a30d ("gve: Add transmit and receive support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/google/gve/gve_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
index eef500bd2ff7..b65f6b010a82 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -625,8 +625,10 @@ static int gve_alloc_qpls(struct gve_priv *priv)
 				     sizeof(unsigned long) * BITS_PER_BYTE;
 	priv->qpl_cfg.qpl_id_map = kvzalloc(BITS_TO_LONGS(num_qpls) *
 					    sizeof(unsigned long), GFP_KERNEL);
-	if (!priv->qpl_cfg.qpl_id_map)
+	if (!priv->qpl_cfg.qpl_id_map) {
+		err = -ENOMEM;
 		goto free_qpls;
+	}
 
 	return 0;




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] gve: Fix error return code in gve_alloc_qpls()
  2019-07-05  1:16 [PATCH net-next] gve: Fix error return code in gve_alloc_qpls() Wei Yongjun
@ 2019-07-08  2:35 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-07-08  2:35 UTC (permalink / raw)
  To: weiyongjun1
  Cc: csully, sagis, jonolson, colin.king, willemb, lrizzo, netdev,
	kernel-janitors

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Fri, 5 Jul 2019 01:16:42 +0000

> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: f5cedc84a30d ("gve: Add transmit and receive support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-08  2:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05  1:16 [PATCH net-next] gve: Fix error return code in gve_alloc_qpls() Wei Yongjun
2019-07-08  2:35 ` 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).