提交 dd1d3f8f 编写于 作者: W Wei Yongjun 提交者: David S. Miller

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: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: NHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 332cfc82
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册