[NTOS:PNP] PiNotifyTargetDeviceChange: Don't free incorrect buffer

This commit is contained in:
Adam Słaboń 2024-03-03 00:17:39 +01:00 committed by Hermès BÉLUSCA - MAÏTO
parent 77af265315
commit 1d18b12ff7

View file

@ -315,7 +315,8 @@ PiNotifyTargetDeviceChange(
}
KeReleaseGuardedMutex(&PiNotifyTargetDeviceLock);
ExFreePoolWithTag(notificationStruct, TAG_PNP_NOTIFY);
if (notificationStruct != CustomNotification)
ExFreePoolWithTag(notificationStruct, TAG_PNP_NOTIFY);
ObDereferenceObject(DeviceObject);
}