Commit 3a7546d9 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: vmbus: Cleanup error codes in connection.c

Cleanup error codes in connection.c.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 39594abc
...@@ -51,13 +51,13 @@ int vmbus_connect(void) ...@@ -51,13 +51,13 @@ int vmbus_connect(void)
/* Make sure we are not connecting or connected */ /* Make sure we are not connecting or connected */
if (vmbus_connection.conn_state != DISCONNECTED) if (vmbus_connection.conn_state != DISCONNECTED)
return -1; return -EISCONN;
/* Initialize the vmbus connection */ /* Initialize the vmbus connection */
vmbus_connection.conn_state = CONNECTING; vmbus_connection.conn_state = CONNECTING;
vmbus_connection.work_queue = create_workqueue("hv_vmbus_con"); vmbus_connection.work_queue = create_workqueue("hv_vmbus_con");
if (!vmbus_connection.work_queue) { if (!vmbus_connection.work_queue) {
ret = -1; ret = -ENOMEM;
goto cleanup; goto cleanup;
} }
...@@ -74,7 +74,7 @@ int vmbus_connect(void) ...@@ -74,7 +74,7 @@ int vmbus_connect(void)
vmbus_connection.int_page = vmbus_connection.int_page =
(void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, 0); (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, 0);
if (vmbus_connection.int_page == NULL) { if (vmbus_connection.int_page == NULL) {
ret = -1; ret = -ENOMEM;
goto cleanup; goto cleanup;
} }
...@@ -90,7 +90,7 @@ int vmbus_connect(void) ...@@ -90,7 +90,7 @@ int vmbus_connect(void)
vmbus_connection.monitor_pages = vmbus_connection.monitor_pages =
(void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 1); (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 1);
if (vmbus_connection.monitor_pages == NULL) { if (vmbus_connection.monitor_pages == NULL) {
ret = -1; ret = -ENOMEM;
goto cleanup; goto cleanup;
} }
...@@ -157,7 +157,7 @@ int vmbus_connect(void) ...@@ -157,7 +157,7 @@ int vmbus_connect(void)
pr_err("Unable to connect, " pr_err("Unable to connect, "
"Version %d not supported by Hyper-V\n", "Version %d not supported by Hyper-V\n",
VMBUS_REVISION_NUMBER); VMBUS_REVISION_NUMBER);
ret = -1; ret = -ECONNREFUSED;
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