]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
linux: Backport Hyper-V network driver
[people/pmueller/ipfire-2.x.git] / src / patches / linux / 0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
diff --git a/src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch b/src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
new file mode 100644 (file)
index 0000000..ab0960d
--- /dev/null
@@ -0,0 +1,34 @@
+From f1009dfec7c439a958bd9ed8893dd6aa692c61f5 Mon Sep 17 00:00:00 2001
+From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Date: Wed, 23 Jul 2014 09:00:35 +0800
+Subject: [PATCH 23/25] hyperv: Fix error return code in netvsc_init_buf()
+
+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>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ 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 4ed38eaecea8..d97d5f39a04e 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;
+-- 
+2.4.3
+