From f4a430511eaad888164c163ccaa85b52f3db5cb7 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Mon, 4 Apr 2005 23:11:19 +0000 Subject: [PATCH] Check for an valid mdl pointer before calling IoFreeMdl in IoReadWriteCompletion. svn path=/trunk/; revision=14493 --- reactos/ntoskrnl/io/cleanup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/io/cleanup.c b/reactos/ntoskrnl/io/cleanup.c index b543e5c463d..ef2097c0dc5 100644 --- a/reactos/ntoskrnl/io/cleanup.c +++ b/reactos/ntoskrnl/io/cleanup.c @@ -1,4 +1,4 @@ -/* $Id:$ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -109,7 +109,10 @@ VOID IoReadWriteCompletion(PDEVICE_OBJECT DeviceObject, if (DeviceObject->Flags & DO_DIRECT_IO) { - IoFreeMdl(Irp->MdlAddress); + if (Irp->MdlAddress) + { + IoFreeMdl(Irp->MdlAddress); + } } }