From 9e0a62ad2c8322649abdb56b4951ae18209245bf Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Tue, 20 Nov 2007 11:53:15 +0000 Subject: [PATCH] - Don't create a possibility for CriticalRegion leakage (spotted by PREfast). svn path=/trunk/; revision=30592 --- reactos/drivers/filesystems/vfat/misc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reactos/drivers/filesystems/vfat/misc.c b/reactos/drivers/filesystems/vfat/misc.c index 5016486fb1e..b1f61ae97c2 100644 --- a/reactos/drivers/filesystems/vfat/misc.c +++ b/reactos/drivers/filesystems/vfat/misc.c @@ -142,6 +142,7 @@ NTSTATUS NTAPI VfatBuildRequest ( { NTSTATUS Status; PVFAT_IRP_CONTEXT IrpContext; + KIRQL Irql; DPRINT ("VfatBuildRequest (DeviceObject %x, Irp %x)\n", DeviceObject, Irp); @@ -156,17 +157,18 @@ NTSTATUS NTAPI VfatBuildRequest ( } else { - if (KeGetCurrentIrql() <= PASSIVE_LEVEL) + Irql = KeGetCurrentIrql(); + if (Irql <= PASSIVE_LEVEL) { FsRtlEnterFileSystem(); } else { - DPRINT1("Vfat is entered at irql = %d\n", KeGetCurrentIrql()); + DPRINT1("Vfat is entered at irql = %d\n", Irql); } Status = VfatDispatchRequest (IrpContext); - if (KeGetCurrentIrql() <= PASSIVE_LEVEL) + if (Irql <= PASSIVE_LEVEL) { FsRtlExitFileSystem(); }