diff options
author | Weongyo Jeong <weongyo@FreeBSD.org> | 2009-03-18 01:57:54 +0000 |
---|---|---|
committer | Weongyo Jeong <weongyo@FreeBSD.org> | 2009-03-18 01:57:54 +0000 |
commit | 08e06b60c1dd29ce65d0783f324aa4beb7b2efd3 (patch) | |
tree | 08f0276cf8226f91951fe64030213bfe148847b1 /sys/compat | |
parent | 3e7d76cc71075fcf967e1c7f3812111f9c7e504d (diff) | |
download | src-08e06b60c1dd29ce65d0783f324aa4beb7b2efd3.tar.gz src-08e06b60c1dd29ce65d0783f324aa4beb7b2efd3.zip |
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.
Notes
Notes:
svn path=/head/; revision=189942
Diffstat (limited to 'sys/compat')
-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 237da312319b..69bea9e15d6e 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; |