[PATCH] ntoskrnl.exe: check irp for NULL consistently.

Marcus Meissner marcus at jet.franken.de
Thu Oct 30 15:56:59 CDT 2008


Hi,

Coverity CID 805, irp is checked for NULL and used
inconsistently.

Ciao, Marcus
---
 dlls/ntoskrnl.exe/ntoskrnl.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 3f97336..5d663e2 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -292,12 +292,12 @@ PIRP WINAPI IoAllocateIrp( CCHAR stack_size, BOOLEAN charge_quota )
 
     size = sizeof(IRP) + stack_size * sizeof(IO_STACK_LOCATION);
     irp = ExAllocatePool( NonPagedPool, size );
-    if (irp != NULL)
-        IoInitializeIrp( irp, size, stack_size );
+    if (irp == NULL)
+        return NULL;
+    IoInitializeIrp( irp, size, stack_size );
     irp->AllocationFlags = IRP_ALLOCATED_FIXED_SIZE;
     if (charge_quota)
         irp->AllocationFlags |= IRP_LOOKASIDE_ALLOCATION;
-
     return irp;
 }
 
-- 
1.5.6



More information about the wine-patches mailing list