]> xenbits.xensource.com Git - people/pauldu/xeniface.git/commitdiff
Ensure defunct watches have NULL handles
authorOwen Smith <owen.smith@citrix.com>
Thu, 29 Oct 2015 14:49:47 +0000 (14:49 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 2 Nov 2015 14:23:03 +0000 (14:23 +0000)
Signed-off-by: Owen Smith <owen.smith@citrix.com>
src/xeniface/wmi.c

index 0f63ef54d74d9e7af880375eca644cc4c7d27861..c73e99005e0b40ed209557602d49f92773b220be 100644 (file)
@@ -884,6 +884,7 @@ VOID WatchCallbackThread(__in PVOID StartContext) {
                         XenIfaceDebugPrint(WARNING,"SessionSuspendResumeUnwatch %p\n", watch->watchhandle);
 
                         XENBUS_STORE(WatchRemove, &watch->fdoData->StoreInterface, watch->watchhandle);
+                        watch->watchhandle = NULL;
                         StartWatch(watch->fdoData, watch);
                     }
                 }
@@ -1187,6 +1188,7 @@ RemoveSessionLocked(XENIFACE_FDO *fdoData,
     SessionRemoveWatchesLocked(session);
     if (session->transaction != NULL) {
         XENBUS_STORE(TransactionEnd, &fdoData->StoreInterface, session->transaction, FALSE);
+        session->transaction = NULL;
     }
     session->closing = TRUE;
     KeSetEvent(&session->SessionChangedEvent, IO_NO_INCREMENT, FALSE);
@@ -1230,6 +1232,7 @@ void SessionUnwatchWatchesLocked(XenStoreSession *session)
         XenIfaceDebugPrint(TRACE,"Suspend unwatch %p\n", watch->watchhandle);
 
         XENBUS_STORE(WatchRemove, &watch->fdoData->StoreInterface, watch->watchhandle);
+        watch->watchhandle = NULL;
         watch = (XenStoreWatch *)watch->listentry.Flink;
     }
     XenIfaceDebugPrint(TRACE, "WATCHLIST for session %p-----------\n",session);