[WDMAUD_KERNEL]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Mon, 7 Jun 2010 23:00:04 +0000 (23:00 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Mon, 7 Jun 2010 23:00:04 +0000 (23:00 +0000)
- Extend the mdl hack

svn path=/trunk/; revision=47687

reactos/drivers/wdm/audio/legacy/wdmaud/control.c

index 07e9ef8..4fc1d67 100644 (file)
@@ -457,15 +457,16 @@ WdmAudReadWrite(
         Status = KsProbeStreamIrp(Irp, KSPROBE_STREAMREAD | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK, Length);
     }
 
-    /* now free the mdl */
-    IoFreeMdl(Mdl);
-
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("KsProbeStreamIrp failed with Status %x Cancel %u\n", Status, Irp->Cancel);
+        Irp->MdlAddress = Mdl;
         return SetIrpIoStatus(Irp, Status, 0);
     }
 
+    /* now free the mdl */
+    IoFreeMdl(Mdl);
+
     /* get device info */
     DeviceInfo = (PWDMAUD_DEVICE_INFO)Irp->AssociatedIrp.SystemBuffer;
     ASSERT(DeviceInfo);