From: Thomas Faber Date: Wed, 11 May 2016 12:30:12 +0000 (+0000) Subject: [I8042PRT] X-Git-Tag: ReactOS-0.4.2~630 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=bae547dceccc9369ba6c62de8961bad5ceb53dab;hp=cfe81c2bb87f4bbb192c514fd2aeffa8b85af812;ds=sidebyside [I8042PRT] - 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 --- diff --git a/reactos/drivers/input/i8042prt/keyboard.c b/reactos/drivers/input/i8042prt/keyboard.c index 01784536f4c..b86c7d75d8a 100644 --- a/reactos/drivers/input/i8042prt/keyboard.c +++ b/reactos/drivers/input/i8042prt/keyboard.c @@ -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; } diff --git a/reactos/drivers/input/i8042prt/mouse.c b/reactos/drivers/input/i8042prt/mouse.c index 16ea8cd86f4..09516c1fe41 100644 --- a/reactos/drivers/input/i8042prt/mouse.c +++ b/reactos/drivers/input/i8042prt/mouse.c @@ -544,9 +544,11 @@ cleanup: } } - Irp->IoStatus.Status = Status; if (Status != STATUS_PENDING) + { + Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); + } return Status; }