[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 1/6] Fix minor xencontrol issues



- Fix mismatched XcStoreRead() function signatures
- Fix memory leak in XcOpen()
- Fix IOCTL names in error messages

Signed-off-by: Rafał Wojdyła <omeg@xxxxxxxxxxxxxxxxxxxxxx>
---
 include/xencontrol.h        |  2 +-
 src/xencontrol/xencontrol.c | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/xencontrol.h b/include/xencontrol.h
index 4560bc6..29cd208 100644
--- a/include/xencontrol.h
+++ b/include/xencontrol.h
@@ -244,7 +244,7 @@ XENCONTROL_API
 DWORD
 XcStoreRead(
     IN  PXENCONTROL_CONTEXT Xc,
-    IN  PCHAR Path,
+    IN  PSTR Path,
     IN  DWORD cbValue,
     OUT CHAR *Value
     );
diff --git a/src/xencontrol/xencontrol.c b/src/xencontrol/xencontrol.c
index 777fd29..5cd9461 100644
--- a/src/xencontrol/xencontrol.c
+++ b/src/xencontrol/xencontrol.c
@@ -168,6 +168,8 @@ fail:
          L"Error: 0x%x", GetLastError());
 
     free(DetailData);
+    free(Context);
+    *Xc = NULL;
     return GetLastError();
 }
 
@@ -208,7 +210,7 @@ XcEvtchnOpenUnbound(
                               NULL);
 
     if (!Success) {
-        Log(XLL_ERROR, L"IOCTL_XENIFACE_EVTCHN_BIND_UNBOUND_PORT failed");
+        Log(XLL_ERROR, L"IOCTL_XENIFACE_EVTCHN_BIND_UNBOUND failed");
         goto fail;
     }
 
@@ -442,11 +444,11 @@ XcGnttabPermitForeignAccess(
     // this IOCTL is expected to be pending on success
     if (!Success) {
         if (Status != ERROR_IO_PENDING) {
-            Log(XLL_ERROR, L"IOCTL_XENIFACE_GNTTAB_GRANT_PAGES failed");
+            Log(XLL_ERROR, L"IOCTL_XENIFACE_GNTTAB_PERMIT_FOREIGN_ACCESS 
failed");
             goto fail;
         }
     } else {
-        Log(XLL_ERROR, L"IOCTL_XENIFACE_GNTTAB_GRANT_PAGES not pending");
+        Log(XLL_ERROR, L"IOCTL_XENIFACE_GNTTAB_PERMIT_FOREIGN_ACCESS not 
pending");
         Status = ERROR_UNIDENTIFIED_ERROR;
         goto fail;
     }
@@ -506,7 +508,7 @@ XcGnttabRevokeForeignAccess(
 
     Status = GetLastError();
     if (!Success) {
-        Log(XLL_ERROR, L"IOCTL_XENIFACE_GNTTAB_UNGRANT_PAGES failed");
+        Log(XLL_ERROR, L"IOCTL_XENIFACE_GNTTAB_REVOKE_FOREIGN_ACCESS failed");
         goto fail;
     }
 
-- 
2.40.1.windows.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.