From 5a10bbf09a3dbcf418bde9321cdf662dfefddb78 Mon Sep 17 00:00:00 2001 From: Owen Smith Date: Fri, 3 May 2024 11:34:09 +0100 Subject: [PATCH] Fix ASSERT in PdoUnplugRequest PdoUnplugRequest can be called multiple times on the same Pdo if the child device is restarted during child device installation. Avoid ASSERT in checked build and prevent incorrect increment of the unplug values. Signed-off-by: Owen Smith --- src/xenvif/pdo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c index 46b43a9..a3ae061 100644 --- a/src/xenvif/pdo.c +++ b/src/xenvif/pdo.c @@ -1234,7 +1234,11 @@ PdoUnplugRequest( { NTSTATUS status; - ASSERT3U(Pdo->UnplugRequested, !=, Make); + // When a driver is restarted, PdoUnplugRequest is called again, + // dont increment the unplug count again. + if (Pdo->UnplugRequested == Make) + return; + Pdo->UnplugRequested = Make; status = XENBUS_UNPLUG(Acquire, &Pdo->UnplugInterface); -- 2.39.5