From: Paul Durrant Date: Thu, 3 Dec 2015 12:33:38 +0000 (+0000) Subject: Fix snafu on setting active device when no vendor device is set X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3ab9a9ab1f9675b10ce5341ef013d988542eb747;p=people%2Fpauldu%2Fxenbus.git Fix snafu on setting active device when no vendor device is set If XENBUS is built with no vendor device then the check for vendor device presences was using NULL. This patch skips the check in that case. Signed-off-by: Paul Durrant --- diff --git a/src/xenbus/driver.c b/src/xenbus/driver.c index b1a5cb3..73625ef 100644 --- a/src/xenbus/driver.c +++ b/src/xenbus/driver.c @@ -292,15 +292,18 @@ DriverGetActive( return STATUS_SUCCESS; fail3: - Error("fail3\n"); + if (status != STATUS_OBJECT_NAME_NOT_FOUND) + Error("fail3\n"); fail2: - Error("fail2\n"); + if (status != STATUS_OBJECT_NAME_NOT_FOUND) + Error("fail2\n"); RegistryCloseKey(ActiveKey); fail1: - Error("fail1 (%08x)\n", status); + if (status != STATUS_OBJECT_NAME_NOT_FOUND) + Error("fail1 (%08x)\n", status); return status; } @@ -346,6 +349,9 @@ __DriverIsVendorDevicePresent( BOOLEAN Found; NTSTATUS status; + if (DriverVendorDeviceID == NULL) + return FALSE; + status = RegistryOpenSubKey(NULL, ENUM_PATH, KEY_READ,