]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Drivers: hv: vmbus: Do not attempt to negoatiate a new version prematurely
authorK. Y. Srinivasan <kys@microsoft.com>
Wed, 28 Aug 2013 21:56:54 +0000 (14:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Aug 2013 19:08:04 +0000 (12:08 -0700)
The current code would attempt to negotiate a different protocol version if
the current negotiation timed out. This triggers an assert in the host (on debug
builds). Avoid this by negotiating a newer version only if the host properly
rejects the current version being negotiated.

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

index ec3b8cdf1e043fe6a987929c24739fa8df282ba7..8f4743ab5fb279ae416fbce5ff4e16e58db45eaf 100644 (file)
@@ -195,7 +195,10 @@ int vmbus_connect(void)
 
        do {
                ret = vmbus_negotiate_version(msginfo, version);
-               if (ret == 0)
+               if (ret)
+                       goto cleanup;
+
+               if (vmbus_connection.conn_state == CONNECTED)
                        break;
 
                version = vmbus_get_next_version(version);