From: Wei Yongjun Date: Wed, 23 Jul 2014 01:00:35 +0000 (+0800) Subject: hyperv: Fix error return code in netvsc_init_buf() X-Git-Tag: firefly_0821_release~176^2~3540^2~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dd1d3f8f9920926aa426589e542eed6bf58b7354;p=firefly-linux-kernel-4.4.55.git 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 Reviewed-by: Haiyang Zhang Signed-off-by: David S. Miller --- 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;