]>
Commit | Line | Data |
---|---|---|
a7b0967d MT |
1 | From dd1d3f8f9920926aa426589e542eed6bf58b7354 Mon Sep 17 00:00:00 2001 |
2 | From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> | |
3 | Date: Wed, 23 Jul 2014 09:00:35 +0800 | |
4 | Subject: [PATCH 09/11] hyperv: Fix error return code in netvsc_init_buf() | |
5 | ||
6 | Fix to return -ENOMEM from the kalloc error handling | |
7 | case instead of 0. | |
8 | ||
9 | Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> | |
10 | Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> | |
11 | Signed-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 | ||
16 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c | |
17 | index 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 | -- | |
33 | 2.4.3 | |
34 |