Skip to content

Commit

Permalink
hyperv: Fix error return code in netvsc_init_buf()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Jul 23, 2014
1 parent 332cfc8 commit dd1d3f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit dd1d3f8

Please sign in to comment.