From d1583c9639ae879b49d814d5f6e5f35e14ad9eb3 Mon Sep 17 00:00:00 2001 From: "K. Y. Srinivasan" Date: Wed, 31 Aug 2011 14:35:54 -0700 Subject: [PATCH] --- yaml --- r: 268125 b: refs/heads/master c: d531babe8259992be32144f2c80fa5e15f9d4d26 h: refs/heads/master i: 268123: b5e231b8ddd4cda04be672d6e0bc717de0976097 v: v3 --- [refs] | 2 +- trunk/drivers/staging/hv/hv_util.c | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f774b80b25e1..7fd47846e0fb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 06b3f44a9784c48c64dfedf5f012deb93049a3aa +refs/heads/master: d531babe8259992be32144f2c80fa5e15f9d4d26 diff --git a/trunk/drivers/staging/hv/hv_util.c b/trunk/drivers/staging/hv/hv_util.c index e29a2a23eda5..603921771b94 100644 --- a/trunk/drivers/staging/hv/hv_util.c +++ b/trunk/drivers/staging/hv/hv_util.c @@ -277,6 +277,7 @@ static struct hv_driver util_drv = { static int __init init_hyperv_utils(void) { + int ret; pr_info("Registering HyperV Utility Driver\n"); if (hv_kvp_init()) @@ -289,12 +290,15 @@ static int __init init_hyperv_utils(void) if (!shut_txf_buf || !time_txf_buf || !hbeat_txf_buf) { pr_info("Unable to allocate memory for receive buffer\n"); - kfree(shut_txf_buf); - kfree(time_txf_buf); - kfree(hbeat_txf_buf); - return -ENOMEM; + ret = -ENOMEM; + goto err; } + ret = vmbus_driver_register(&util_drv); + + if (ret != 0) + goto err; + hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback; hv_cb_utils[HV_TIMESYNC_MSG].callback = ×ync_onchannelcallback; @@ -303,7 +307,14 @@ static int __init init_hyperv_utils(void) hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback; - return vmbus_driver_register(&util_drv); + return 0; + +err: + kfree(shut_txf_buf); + kfree(time_txf_buf); + kfree(hbeat_txf_buf); + + return ret; } static void exit_hyperv_utils(void)