Release the correct locks and release they in the correct sequence.
[reactos.git] / reactos / drivers / fs / np / fsctrl.c
index 5dcacd4..a148860 100644 (file)
@@ -22,10 +22,11 @@ NpfsListeningCancelRoutine(IN PDEVICE_OBJECT DeviceObject,
 {
   PNPFS_WAITER_ENTRY Waiter;
 
-  DPRINT1("NpfsListeningCancelRoutine() called\n");
-
   Waiter = (PNPFS_WAITER_ENTRY)&Irp->Tail.Overlay.DriverContext;
 
+  DPRINT1("NpfsListeningCancelRoutine() called for <%wZ>\n",
+         &Waiter->Fcb->Pipe->PipeName);
+
   IoReleaseCancelSpinLock(Irp->CancelIrql);
 
 
@@ -207,12 +208,12 @@ NpfsDisconnectPipe(PNPFS_FCB Fcb)
       KeSetEvent(&OtherSide->WriteEvent, IO_NO_INCREMENT, FALSE);
       if (Server)
       {
-         ExReleaseFastMutex(&Fcb->DataListLock);
         ExReleaseFastMutex(&OtherSide->DataListLock);
+         ExReleaseFastMutex(&Fcb->DataListLock);
       }
       else
       {
-        ExReleaseFastMutex(&OtherSide->DataListLock);
+         ExReleaseFastMutex(&Fcb->DataListLock);
         ExReleaseFastMutex(&OtherSide->DataListLock);
       }
       Status = STATUS_SUCCESS;