[NPFS]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 1 Jun 2010 09:52:16 +0000 (09:52 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 1 Jun 2010 09:52:16 +0000 (09:52 +0000)
- Check if MmGetSystemAddressForMdlSafe failed

svn path=/trunk/; revision=47512

reactos/drivers/filesystems/npfs/rw.c

index 6f8675e..5a03977 100644 (file)
@@ -781,7 +781,16 @@ NpfsWrite(PDEVICE_OBJECT DeviceObject,
     }
 
     Status = STATUS_SUCCESS;
-    Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress);
+    Buffer = MmGetSystemAddressForMdlSafe (Irp->MdlAddress, NormalPagePriority);
+
+    if (!Buffer)
+    {
+        DPRINT("MmGetSystemAddressForMdlSafe failed\n");
+        Status = STATUS_INSUFFICIENT_RESOURCES;
+        Length = 0;
+        goto done;
+
+    }
 
     ExAcquireFastMutex(&ReaderCcb->DataListLock);