Drivers: hv: vmbus: Do not attempt to negoatiate a new version prematurely

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>
This commit is contained in:
K. Y. Srinivasan 2013-08-28 14:56:54 -07:00 committed by Greg Kroah-Hartman
parent e83736c802
commit 666b9adc80

View 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);