[libbus] Discard queued IRPs for a removed bus
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Mon, 3 Jan 2011 10:22:30 +0000 (05:22 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Mon, 3 Jan 2011 10:22:30 +0000 (05:22 -0500)
Once an FDO association is gone, any remaining IRPs
need to be cancelled because there's no device!

src/winvblock/libbus/libbus.c

index fee60f3..8c8683a 100644 (file)
@@ -256,6 +256,8 @@ WVL_M_LIB VOID WvlBusProcessWorkItems(WVL_SP_BUS_T Bus) {
               irp = work_item->Context.Irp;
               io_stack_loc = IoGetCurrentIrpStackLocation(irp);
               dev_obj = Bus->Fdo;
+              if (!dev_obj)
+                WvlIrpComplete(irp, 0, STATUS_NO_SUCH_DEVICE);
               driver_obj = dev_obj->DriverObject;
               driver_obj->MajorFunction[io_stack_loc->MajorFunction](
                   dev_obj,