All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hyperv: Fix error return code in netvsc_init_buf()
@ 2014-07-23  1:00 weiyj_lk
  2014-07-23 15:25 ` Haiyang Zhang
  2014-07-23 21:56 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: weiyj_lk @ 2014-07-23  1:00 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang; +Cc: devel, Wei Yongjun, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return -ENOMEM from the kalloc error handling
case instead of 0.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/hyperv/netvsc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 4ed38ea..d97d5f3 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -378,8 +378,10 @@ static int netvsc_init_buf(struct hv_device *device)
 
 	net_device->send_section_map =
 		kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL);
-	if (net_device->send_section_map == NULL)
+	if (net_device->send_section_map == NULL) {
+		ret = -ENOMEM;
 		goto cleanup;
+	}
 
 	goto exit;

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

* RE: [PATCH] hyperv: Fix error return code in netvsc_init_buf()
  2014-07-23  1:00 [PATCH] hyperv: Fix error return code in netvsc_init_buf() weiyj_lk
@ 2014-07-23 15:25 ` Haiyang Zhang
  2014-07-23 21:56 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Haiyang Zhang @ 2014-07-23 15:25 UTC (permalink / raw)
  To: weiyj_lk, KY Srinivasan; +Cc: Wei Yongjun, devel, netdev



> -----Original Message-----
> From: weiyj_lk@163.com [mailto:weiyj_lk@163.com]
> Sent: Tuesday, July 22, 2014 9:01 PM
> To: KY Srinivasan; Haiyang Zhang
> Cc: Wei Yongjun; devel@linuxdriverproject.org; netdev@vger.kernel.org
> Subject: [PATCH] hyperv: Fix error return code in netvsc_init_buf()
> 
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return -ENOMEM from the kalloc error handling
> case instead of 0.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>

Good catch.

Thanks,
- Haiyang

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

* Re: [PATCH] hyperv: Fix error return code in netvsc_init_buf()
  2014-07-23  1:00 [PATCH] hyperv: Fix error return code in netvsc_init_buf() weiyj_lk
  2014-07-23 15:25 ` Haiyang Zhang
@ 2014-07-23 21:56 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-07-23 21:56 UTC (permalink / raw)
  To: weiyj_lk; +Cc: kys, haiyangz, yongjun_wei, devel, netdev

From: weiyj_lk@163.com
Date: Wed, 23 Jul 2014 09:00:35 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return -ENOMEM from the kalloc error handling
> case instead of 0.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied, thank you.

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

end of thread, other threads:[~2014-07-23 21:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23  1:00 [PATCH] hyperv: Fix error return code in netvsc_init_buf() weiyj_lk
2014-07-23 15:25 ` Haiyang Zhang
2014-07-23 21:56 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.