|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XENIFACE-SYNC 3/3] xeniface: Don't remove a NULL watch on resume
If StartWatch() fails, Watch->WatchHandle stays NULL. On the next
suspend/resume, SessionWatchThread() then passes NULL to
XENBUS_STORE(WatchRemove), which dereferences it in xenbus.
Only remove the watch if it was set up, as the other callers already
do, and still call StartWatch() so the watch is set up again.
Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
src/xeniface/wmi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c
index f2b4802..5ba7645 100644
--- a/src/xeniface/wmi.c
+++ b/src/xeniface/wmi.c
@@ -994,8 +994,10 @@ WatchCallbackThread(
Watch->SuspendCount = XENBUS_SUSPEND(GetCount,
&Watch->Fdo->SuspendInterface);
Info("SessionSuspendResumeUnwatch %p\n", Watch->WatchHandle);
- XENBUS_STORE(WatchRemove, &Watch->Fdo->StoreInterface,
Watch->WatchHandle);
- Watch->WatchHandle = NULL;
+ if (Watch->WatchHandle != NULL) {
+ XENBUS_STORE(WatchRemove, &Watch->Fdo->StoreInterface,
Watch->WatchHandle);
+ Watch->WatchHandle = NULL;
+ }
StartWatch(Watch->Fdo, Watch);
} else {
FireWatch(Watch);
--
2.55.0.windows.5
--
Césaire Mounah | Vates Windows Guest Tools Engineer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |