]> xenbits.xensource.com Git - pvdrivers/win/xenvif.git/commitdiff
Port "Ignore unused devices when checking for compatability" from XENBUS
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 20 Dec 2018 17:34:49 +0000 (17:34 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 20 Dec 2018 17:34:49 +0000 (17:34 +0000)
XENBUS commit caf35361 fixes an upgrade issue with dangling references
left in ENUM keys. This patch applies the same fix to XENVIF.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/coinst/coinst.c

index 5fbd3eaa49f9dc5b1dd5d622e047d7a535c83d09..e7495066d4940e237b63731824525131942dfb5c 100644 (file)
@@ -946,28 +946,29 @@ SupportChildDrivers(
             goto fail6;
 
         if (DriverKeyName == NULL)
-            goto loop;
+            goto loop1;
 
         Success = OpenDriverKey(DriverKeyName, &DriverKey);
         if (!Success)
-            goto loop;
+            goto loop2;
 
         Success = GetMatchingDeviceID(DriverKey, &MatchingDeviceID);
         if (!Success)
-            goto fail7;
+            goto loop3;
 
         Success = SupportDeviceID(MatchingDeviceID);
         if (!Success)
-            goto fail8;
+            goto fail7;
 
         free(MatchingDeviceID);
 
+    loop3:
         RegCloseKey(DriverKey);
 
-    loop:
-        if (DriverKeyName != NULL)
-            free(DriverKeyName);
+    loop2:
+        free(DriverKeyName);
 
+    loop1:
         RegCloseKey(DeviceKey);
     }
 
@@ -980,14 +981,11 @@ done:
 
     return TRUE;
 
-fail8:
-    Log("fail8");
-
-    free(MatchingDeviceID);
-
 fail7:
     Log("fail7");
 
+    free(MatchingDeviceID);
+
     RegCloseKey(DriverKey);
 
     free(DriverKeyName);