]> xenbits.xensource.com Git - people/pauldu/xenbus.git/commitdiff
Don't treat a missing Driver key as a hard failure
authorPaul Durrant <paul.durrant@citrix.com>
Tue, 8 Sep 2015 13:20:19 +0000 (14:20 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Tue, 8 Sep 2015 13:20:19 +0000 (14:20 +0100)
When looking to see whether an incumbent child driver will patch the
PDO names created by the new version of XENBUS, ignore any cases where
we find that the Driver key referenced in the Device key is actually
missing.

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

index 68e32654332b97bbd0eb5f738eea111c629a2284..09ef84780fe5049d44a3090e50987dc7f8a46dda 100644 (file)
@@ -704,7 +704,7 @@ found:
 
     Success = OpenDriverKey(DriverKeyName, &DriverKey);
     if (!Success)
-        goto fail5;
+        goto done;
 
     Error = RegQueryInfoKey(DriverKey,
                             NULL,
@@ -720,14 +720,14 @@ found:
                             NULL);
     if (Error != ERROR_SUCCESS) {
         SetLastError(Error);
-        goto fail6;
+        goto fail5;
     }
 
     DriverDescLength = MaxValueLength + sizeof (TCHAR);
 
     DriverDesc = calloc(1, DriverDescLength);
     if (DriverDesc == NULL)
-        goto fail7;
+        goto fail6;
 
     Error = RegQueryValueEx(DriverKey,
                             "DriverDesc",
@@ -740,12 +740,12 @@ found:
             goto done;
 
         SetLastError(Error);
-        goto fail8;
+        goto fail7;
     }
 
     if (Type != REG_SZ) {
         SetLastError(ERROR_BAD_FORMAT);
-        goto fail9;
+        goto fail8;
     }
 
     ProductNameLength = (DWORD)strlen(PRODUCT_NAME_STR);
@@ -754,13 +754,13 @@ found:
                 PRODUCT_NAME_STR,
                 ProductNameLength) != 0) {
         SetLastError(ERROR_INSTALL_FAILURE);
-        goto fail10;
+        goto fail9;
     }
 
     if (strcmp(DriverDesc + ProductNameLength,
                " PV Bus") != 0) {
         SetLastError(ERROR_INSTALL_FAILURE);
-        goto fail11;
+        goto fail10;
     }
 
 done:
@@ -781,9 +781,6 @@ done:
 
     return TRUE;
 
-fail11:
-    Log("fail11");
-
 fail10:
     Log("fail10");
 
@@ -793,19 +790,19 @@ fail9:
 fail8:
     Log("fail8");
 
-    free(DriverDesc);
-
 fail7:
     Log("fail7");
 
+    free(DriverDesc);
+
 fail6:
     Log("fail6");
 
-    RegCloseKey(DriverKey);
-
 fail5:
     Log("fail5");
 
+    RegCloseKey(DriverKey);
+
     free(DriverKeyName);
 
 fail4: