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 <owen.smith@cloud.com>
{
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);