Drivers: hv: util: On device remove, close the channel after de-initializing the...
authorK. Y. Srinivasan <kys@microsoft.com>
Sat, 28 Feb 2015 19:18:20 +0000 (11:18 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Mar 2015 03:31:02 +0000 (19:31 -0800)
When the offer is rescinded, vmbus_close() can free up the channel;
deinitialize the service before closing the channel.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv_util.c

index c5be7737559f031f93a76c1aa45055cc515e7f07..7994ec2e4151b085bbcb596d8ddbd4d8765b939e 100644 (file)
@@ -380,9 +380,9 @@ static int util_remove(struct hv_device *dev)
 {
        struct hv_util_service *srv = hv_get_drvdata(dev);
 
-       vmbus_close(dev->channel);
        if (srv->util_deinit)
                srv->util_deinit();
+       vmbus_close(dev->channel);
        kfree(srv->recv_buffer);
 
        return 0;