From e2be36788716b711e6640b765e1ec52c35be8987 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Tue, 1 Jun 2010 09:52:16 +0000 Subject: [PATCH] [NPFS] - Check if MmGetSystemAddressForMdlSafe failed svn path=/trunk/; revision=47512 --- reactos/drivers/filesystems/npfs/rw.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/filesystems/npfs/rw.c b/reactos/drivers/filesystems/npfs/rw.c index 6f8675ed754..5a03977a788 100644 --- a/reactos/drivers/filesystems/npfs/rw.c +++ b/reactos/drivers/filesystems/npfs/rw.c @@ -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); -- 2.17.1