[PORTCLS] Handle failure return from QueryPowerChangeState. CORE-16611

This commit is contained in:
Thomas Faber 2020-02-01 13:09:11 +01:00
parent 5a43c52bbb
commit e4e86c32e7
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -267,8 +267,14 @@ PortClsPower(
PowerState = IoStack->Parameters.Power.State;
Status = DeviceExtension->AdapterPowerManagement->QueryPowerChangeState(PowerState);
// sanity check
PC_ASSERT(Status == STATUS_SUCCESS);
if (!NT_SUCCESS(Status))
{
// fail the IRP if the adapter power manager failed
PoStartNextPowerIrp(Irp);
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
}
// only forward query requests