]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
util-linux: update rootfile (armv5tel)
[ipfire-2.x.git] / src / patches / linux / 0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
CommitLineData
a7b0967d
MT
1From f1009dfec7c439a958bd9ed8893dd6aa692c61f5 Mon Sep 17 00:00:00 2001
2From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
3Date: Wed, 23 Jul 2014 09:00:35 +0800
4Subject: [PATCH 23/25] hyperv: Fix error return code in netvsc_init_buf()
5
6Fix to return -ENOMEM from the kalloc error handling
7case instead of 0.
8
9Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
10Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
11Signed-off-by: David S. Miller <davem@davemloft.net>
12---
13 drivers/net/hyperv/netvsc.c | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
15
16diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
17index 4ed38eaecea8..d97d5f39a04e 100644
18--- a/drivers/net/hyperv/netvsc.c
19+++ b/drivers/net/hyperv/netvsc.c
20@@ -378,8 +378,10 @@ static int netvsc_init_buf(struct hv_device *device)
21
22 net_device->send_section_map =
23 kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL);
24- if (net_device->send_section_map == NULL)
25+ if (net_device->send_section_map == NULL) {
26+ ret = -ENOMEM;
27 goto cleanup;
28+ }
29
30 goto exit;
31
32--
332.4.3
34