[I8042PRT]
authorThomas Faber <thomas.faber@reactos.org>
Wed, 11 May 2016 12:30:12 +0000 (12:30 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Wed, 11 May 2016 12:30:12 +0000 (12:30 +0000)
- Don't access device control IRPs after handing them off to a worker routine that has potentially already freed them.
CORE-11229 #resolve

svn path=/trunk/; revision=71316

reactos/drivers/input/i8042prt/keyboard.c
reactos/drivers/input/i8042prt/mouse.c

index 0178453..b86c7d7 100644 (file)
@@ -467,11 +467,11 @@ i8042KbdDeviceControl(
                }
        }
 
-       Irp->IoStatus.Status = Status;
-       if (Status == STATUS_PENDING)
-               IoMarkIrpPending(Irp);
-       else
+       if (Status != STATUS_PENDING)
+       {
+               Irp->IoStatus.Status = Status;
                IoCompleteRequest(Irp, IO_NO_INCREMENT);
+       }
 
        return Status;
 }
@@ -738,9 +738,11 @@ cleanup:
                }
        }
 
-       Irp->IoStatus.Status = Status;
        if (Status != STATUS_PENDING)
+       {
+               Irp->IoStatus.Status = Status;
                IoCompleteRequest(Irp, IO_NO_INCREMENT);
+       }
        return Status;
 }
 
index 16ea8cd..09516c1 100644 (file)
@@ -544,9 +544,11 @@ cleanup:
                }
        }
 
-       Irp->IoStatus.Status = Status;
        if (Status != STATUS_PENDING)
+       {
+               Irp->IoStatus.Status = Status;
                IoCompleteRequest(Irp, IO_NO_INCREMENT);
+       }
        return Status;
 }