Commit 927bc33c authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf()

Use standard Linux error codes.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a3e00530
...@@ -207,7 +207,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -207,7 +207,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
if (!net_device) { if (!net_device) {
dev_err(&device->device, "unable to get net device..." dev_err(&device->device, "unable to get net device..."
"device being destroyed?"); "device being destroyed?");
return -1; return -ENODEV;
} }
net_device->recv_buf = net_device->recv_buf =
...@@ -216,7 +216,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -216,7 +216,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
if (!net_device->recv_buf) { if (!net_device->recv_buf) {
dev_err(&device->device, "unable to allocate receive " dev_err(&device->device, "unable to allocate receive "
"buffer of size %d", net_device->recv_buf_size); "buffer of size %d", net_device->recv_buf_size);
ret = -1; ret = -ENOMEM;
goto cleanup; goto cleanup;
} }
...@@ -269,7 +269,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -269,7 +269,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
"initialzation with NetVsp - status %d", "initialzation with NetVsp - status %d",
init_packet->msg.v1_msg. init_packet->msg.v1_msg.
send_recv_buf_complete.status); send_recv_buf_complete.status);
ret = -1; ret = -EINVAL;
goto cleanup; goto cleanup;
} }
...@@ -281,7 +281,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -281,7 +281,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
net_device->recv_section = kmalloc(net_device->recv_section_cnt net_device->recv_section = kmalloc(net_device->recv_section_cnt
* sizeof(struct nvsp_1_receive_buffer_section), GFP_KERNEL); * sizeof(struct nvsp_1_receive_buffer_section), GFP_KERNEL);
if (net_device->recv_section == NULL) { if (net_device->recv_section == NULL) {
ret = -1; ret = -EINVAL;
goto cleanup; goto cleanup;
} }
...@@ -297,7 +297,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -297,7 +297,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
*/ */
if (net_device->recv_section_cnt != 1 || if (net_device->recv_section_cnt != 1 ||
net_device->recv_section->offset != 0) { net_device->recv_section->offset != 0) {
ret = -1; ret = -EINVAL;
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment