diff options
author | weongyo <weongyo@FreeBSD.org> | 2009-03-18 01:57:54 +0000 |
---|---|---|
committer | weongyo <weongyo@FreeBSD.org> | 2009-03-18 01:57:54 +0000 |
commit | bcc40d445d09395afa286b5446648255d2cb5968 (patch) | |
tree | 08f0276cf8226f91951fe64030213bfe148847b1 | |
parent | 54b298a418a63f158b09666a36f1554234fb2e30 (diff) | |
download | FreeBSD-src-bcc40d445d09395afa286b5446648255d2cb5968.zip FreeBSD-src-bcc40d445d09395afa286b5446648255d2cb5968.tar.gz |
If the caller sets irp_usriostat or irp_usrevent it try to process it
whatever the IRP flag is because some drivers (eg. RTL8187L NDIS driver)
call IoCompleteRequest() without setting flags. It will prevent waiting
a event forever at attach.
-rw-r--r-- | sys/compat/ndis/subr_ntoskrnl.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index 237da31..69bea9e 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -1197,6 +1197,11 @@ IofCompleteRequest(irp *ip, uint8_t prioboost) sl++; } while (ip->irp_currentstackloc <= (ip->irp_stackcnt + 1)); + if (ip->irp_usriostat != NULL) + *ip->irp_usriostat = ip->irp_iostat; + if (ip->irp_usrevent != NULL) + KeSetEvent(ip->irp_usrevent, prioboost, FALSE); + /* Handle any associated IRPs. */ if (ip->irp_flags & IRP_ASSOCIATED_IRP) { @@ -1220,16 +1225,10 @@ IofCompleteRequest(irp *ip, uint8_t prioboost) /* With any luck, these conditions will never arise. */ - if (ip->irp_flags & (IRP_PAGING_IO|IRP_CLOSE_OPERATION)) { - if (ip->irp_usriostat != NULL) - *ip->irp_usriostat = ip->irp_iostat; - if (ip->irp_usrevent != NULL) - KeSetEvent(ip->irp_usrevent, prioboost, FALSE); - if (ip->irp_flags & IRP_PAGING_IO) { - if (ip->irp_mdl != NULL) - IoFreeMdl(ip->irp_mdl); - IoFreeIrp(ip); - } + if (ip->irp_flags & IRP_PAGING_IO) { + if (ip->irp_mdl != NULL) + IoFreeMdl(ip->irp_mdl); + IoFreeIrp(ip); } return; |