summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2014-07-23 09:00:35 +0800
committerDavid S. Miller <davem@davemloft.net>2014-07-23 14:55:47 -0700
commitdd1d3f8f9920926aa426589e542eed6bf58b7354 (patch)
tree2bb05de02d8226ae35c74ba4cbc530bba61b5e22 /drivers
parent332cfc823d182d43bfcc80d1ebee7ab79e06ccf3 (diff)
downloadlinux-dd1d3f8f9920926aa426589e542eed6bf58b7354.tar.bz2
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/hyperv/netvsc.c4
1 files changed, 3 insertions, 1 deletions
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;