https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e4e86c32e7f119a7cd10d8dd44c7af889c35036e

commit e4e86c32e7f119a7cd10d8dd44c7af889c35036e
Author:     Thomas Faber <[email protected]>
AuthorDate: Sat Feb 1 13:09:11 2020 +0100
Commit:     Thomas Faber <[email protected]>
CommitDate: Sat Feb 8 13:07:34 2020 +0100

    [PORTCLS] Handle failure return from QueryPowerChangeState. CORE-16611
---
 drivers/wdm/audio/backpln/portcls/irp.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/wdm/audio/backpln/portcls/irp.cpp 
b/drivers/wdm/audio/backpln/portcls/irp.cpp
index be4f008e655..8d775bfe493 100644
--- a/drivers/wdm/audio/backpln/portcls/irp.cpp
+++ b/drivers/wdm/audio/backpln/portcls/irp.cpp
@@ -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

Reply via email to