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: v3.16~18^2~16 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=dd1d3f8f9920926aa426589e542eed6bf58b7354;p=~emulex%2Finfiniband.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 4ed38eaecea..d97d5f39a04 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;