If the backend does not implement the control ring then the frontend will
eventually deadlock. Also, by inspection, the teardown code does not
release interfaces if the control ring was not present.
This patch fixes both issues.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
__ControllerAcquireLock(Controller);
- if (!Controller->Connected)
+ if (!Controller->Connected) {
+ __ControllerReleaseLock(Controller);
goto done;
+ }
Controller->Connected = FALSE;
Controller->GnttabCache);
Controller->GnttabCache = NULL;
+done:
XENBUS_GNTTAB(Release, &Controller->GnttabInterface);
XENBUS_EVTCHN(Release, &Controller->EvtchnInterface);
XENBUS_DEBUG(Release, &Controller->DebugInterface);
-done:
Trace("<====\n");
}