Commit 0f48c72c authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp()

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 927bc33c
...@@ -323,7 +323,7 @@ static int netvsc_connect_vsp(struct hv_device *device) ...@@ -323,7 +323,7 @@ static int netvsc_connect_vsp(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;
} }
init_packet = &net_device->channel_init_pkt; init_packet = &net_device->channel_init_pkt;
...@@ -354,13 +354,13 @@ static int netvsc_connect_vsp(struct hv_device *device) ...@@ -354,13 +354,13 @@ static int netvsc_connect_vsp(struct hv_device *device)
if (init_packet->msg.init_msg.init_complete.status != if (init_packet->msg.init_msg.init_complete.status !=
NVSP_STAT_SUCCESS) { NVSP_STAT_SUCCESS) {
ret = -1; ret = -EINVAL;
goto cleanup; goto cleanup;
} }
if (init_packet->msg.init_msg.init_complete. if (init_packet->msg.init_msg.init_complete.
negotiated_protocol_ver != NVSP_PROTOCOL_VERSION_1) { negotiated_protocol_ver != NVSP_PROTOCOL_VERSION_1) {
ret = -1; ret = -EPROTO;
goto cleanup; goto cleanup;
} }
/* Send the ndis version */ /* Send the ndis version */
...@@ -381,10 +381,8 @@ static int netvsc_connect_vsp(struct hv_device *device) ...@@ -381,10 +381,8 @@ static int netvsc_connect_vsp(struct hv_device *device)
sizeof(struct nvsp_message), sizeof(struct nvsp_message),
(unsigned long)init_packet, (unsigned long)init_packet,
VM_PKT_DATA_INBAND, 0); VM_PKT_DATA_INBAND, 0);
if (ret != 0) { if (ret != 0)
ret = -1;
goto cleanup; goto cleanup;
}
/* Post the big receive buffer to NetVSP */ /* Post the big receive buffer to NetVSP */
ret = netvsc_init_recv_buf(device); ret = netvsc_init_recv_buf(device);
......
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