diff --git a/reactos/drivers/filesystems/npfs/datasup.c b/reactos/drivers/filesystems/npfs/datasup.c index 8e408497a73..2bdbf99f278 100644 --- a/reactos/drivers/filesystems/npfs/datasup.c +++ b/reactos/drivers/filesystems/npfs/datasup.c @@ -146,9 +146,10 @@ NpRemoveDataQueueEntry(IN PNP_DATA_QUEUE DataQueue, Irp = QueueEntry->Irp; NpFreeClientSecurityContext(QueueEntry->ClientSecurityContext); - if (Irp && IoSetCancelRoutine(Irp, NULL)) + if (Irp && !IoSetCancelRoutine(Irp, NULL)) { Irp->Tail.Overlay.DriverContext[3] = NULL; + Irp = NULL; } ExFreePool(QueueEntry);