From: K. Y. Srinivasan Date: Thu, 25 Aug 2011 16:49:14 +0000 (-0700) Subject: Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp() X-Git-Tag: MMI-PSA29.97-13-9~18234^2^2~864^2~43 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0f48c72ca63a6e1da7f226163c36fecd7a923fed;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp() Use standard Linux error codes. Signed-off-by: K. Y. Srinivasan Signed-off-by: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c index 5703fd7c5246..9cc126ba8d74 100644 --- a/drivers/staging/hv/netvsc.c +++ b/drivers/staging/hv/netvsc.c @@ -323,7 +323,7 @@ static int netvsc_connect_vsp(struct hv_device *device) if (!net_device) { dev_err(&device->device, "unable to get net device..." "device being destroyed?"); - return -1; + return -ENODEV; } init_packet = &net_device->channel_init_pkt; @@ -354,13 +354,13 @@ static int netvsc_connect_vsp(struct hv_device *device) if (init_packet->msg.init_msg.init_complete.status != NVSP_STAT_SUCCESS) { - ret = -1; + ret = -EINVAL; goto cleanup; } if (init_packet->msg.init_msg.init_complete. negotiated_protocol_ver != NVSP_PROTOCOL_VERSION_1) { - ret = -1; + ret = -EPROTO; goto cleanup; } /* Send the ndis version */ @@ -381,10 +381,8 @@ static int netvsc_connect_vsp(struct hv_device *device) sizeof(struct nvsp_message), (unsigned long)init_packet, VM_PKT_DATA_INBAND, 0); - if (ret != 0) { - ret = -1; + if (ret != 0) goto cleanup; - } /* Post the big receive buffer to NetVSP */ ret = netvsc_init_recv_buf(device);