From ade2b9c4eb1511056ff9abd3852f29f1fd8903f6 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sat, 27 Apr 2002 19:25:57 +0000 Subject: [PATCH] Fixed a bug in findDirSpace(). svn path=/trunk/; revision=2890 --- reactos/drivers/fs/vfat/dirwr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/reactos/drivers/fs/vfat/dirwr.c b/reactos/drivers/fs/vfat/dirwr.c index 82347c6bb32..febf58d86cf 100644 --- a/reactos/drivers/fs/vfat/dirwr.c +++ b/reactos/drivers/fs/vfat/dirwr.c @@ -1,4 +1,4 @@ -/* $Id: dirwr.c,v 1.24 2002/03/18 22:37:12 hbirr Exp $ +/* $Id: dirwr.c,v 1.25 2002/04/27 19:25:57 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -125,6 +125,7 @@ findDirSpace(PDEVICE_EXTENSION DeviceExt, if (Context) { CcUnpinData(Context); + Context = NULL; } if (nbFree == nbSlots) { @@ -164,8 +165,11 @@ findDirSpace(PDEVICE_EXTENSION DeviceExt, TRUE, &Context, (PVOID*)&pFatEntry); RtlZeroMemory(pFatEntry, sizeof(FATDirEntry)); } - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); + if (Context) + { + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + } } DPRINT ("nbSlots %d nbFree %d, entry number %d\n", nbSlots, nbFree, *start); return TRUE;