From: Paul Durrant Date: Thu, 3 Nov 2016 10:11:05 +0000 (+0000) Subject: Fix build warnings X-Git-Tag: 8.2.0-rc1~7 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4a64a41bb24d67846d0b5744984fb8c2973af026;p=pvdrivers%2Fwin%2Fxenvif.git Fix build warnings Signed-off-by: Paul Durrant --- diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c index 0d792f7..36baa24 100644 --- a/src/coinst/coinst.c +++ b/src/coinst/coinst.c @@ -112,15 +112,16 @@ GetErrorMessage( PTCHAR Message; ULONG Index; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - Error, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&Message, - 0, - NULL); + if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + Error, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&Message, + 0, + NULL)) + return NULL; for (Index = 0; Message[Index] != '\0'; Index++) { if (Message[Index] == '\r' || Message[Index] == '\n') { @@ -294,14 +295,14 @@ AllowUpdate( goto fail3; } + RegCloseKey(ServiceKey); + done: if (Value == 0) { Log("DISALLOWED"); *Allow = FALSE; } - RegCloseKey(ServiceKey); - Log("<===="); return TRUE; @@ -554,8 +555,10 @@ GetDriverKeyName( 0, KEY_READ, &SubKey); - if (Error != ERROR_SUCCESS) + if (Error != ERROR_SUCCESS) { + SubKey = NULL; continue; + } Error = RegQueryInfoKey(SubKey, NULL, diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c index a90397a..6414819 100644 --- a/src/xenvif/controller.c +++ b/src/xenvif/controller.c @@ -119,6 +119,7 @@ __ControllerReleaseLock( IN PXENVIF_CONTROLLER Controller ) { +#pragma prefast(suppress:26110) // Caller failing to hold lock KeReleaseSpinLockFromDpcLevel(&Controller->Lock); }