Skip to content

Commit 9624a85

Browse files
committed
[NTOSKRNL]
Fix a bug in FsRtlNotifyCleanup: only remove notification from list when we're about to complete it. svn path=/trunk/; revision=55932
1 parent 4c30c55 commit 9624a85

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

reactos/ntoskrnl/fsrtl/notify.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,13 @@ FsRtlNotifyCleanup(IN PNOTIFY_SYNC NotifySync,
182182
{
183183
FsRtlNotifyCompleteIrpList(NotifyChange, STATUS_NOTIFY_CLEANUP);
184184
}
185-
/* Remove from the list */
186-
RemoveEntryList(&NotifyChange->NotifyList);
187185

188-
/* Downcrease reference number and if 0 is reached, it's time to do complete cleanup */
186+
/* Decrease reference number and if 0 is reached, it's time to do complete cleanup */
189187
if (!InterlockedDecrement((PLONG)&(NotifyChange->ReferenceCount)))
190188
{
189+
/* Remove it from the notifications list */
190+
RemoveEntryList(&NotifyChange->NotifyList);
191+
191192
/* In case there was an allocated buffer, free it */
192193
if (NotifyChange->AllocatedBuffer)
193194
{

0 commit comments

Comments
 (0)