[ofw] [PATCH] Don't return CL_COMPLETED for IRPs completed with an error status

Fab Tillier ftillier at windows.microsoft.com
Tue Jul 8 17:26:15 PDT 2008


Driver verifier caught this one.  If an IRP is completed via IoCompletRequest the IRP dispatch routine needs to return the same status as the IRP's completion status.  There's no reason to use the CL_COMPLETED value here anyway (and it should probably be eliminated to prevent exactly this type of issue.)

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\kernel\al_proxy_ndi.c trunk\core\al\kernel\al_proxy_ndi.c
--- old\core\al\kernel\al_proxy_ndi.c   Tue Jul 08 17:16:42 2008
+++ trunk\core\al\kernel\al_proxy_ndi.c Tue Jul 08 17:19:55 2008
@@ -433,6 +433,7 @@ __ndi_rej_cm(
        ib_api_status_t status;
        ual_ndi_rej_cm_ioctl_in_t *p_rej =
                (ual_ndi_rej_cm_ioctl_in_t*)cl_ioctl_in_buf( h_ioctl );
+       NTSTATUS ntstatus;
        UNUSED_PARAM(p_ret_bytes);

        AL_ENTER( AL_DBG_NDI );
@@ -442,7 +443,7 @@ __ndi_rej_cm(
        /* Check psize */
        if ( p_rej->pdata_size >= sizeof(p_rej->pdata) )
        {
-               h_ioctl->IoStatus.Status = CL_INVALID_PARAMETER;
+               ntstatus = CL_INVALID_PARAMETER;
                goto exit;
        }

@@ -454,20 +455,16 @@ __ndi_rej_cm(
                NULL, 0, p_rej->pdata, p_rej->pdata_size);
        if (status != IB_SUCCESS)
        {
-               h_ioctl->IoStatus.Status = CL_INVALID_HANDLE;
+               ntstatus = CL_INVALID_HANDLE;
                goto exit;
        }

        al_destroy_cep( p_context->h_al, &p_rej->cid, FALSE );
-       h_ioctl->IoStatus.Status = STATUS_SUCCESS;
+       ntstatus = STATUS_SUCCESS;

 exit:
-       /* complete the IRP */
-       h_ioctl->IoStatus.Information = 0;
-       IoCompleteRequest( h_ioctl, IO_NO_INCREMENT );
-
        AL_EXIT( AL_DBG_NDI );
-       return CL_COMPLETED;
+       return ntstatus;
 }

 static cl_status_t
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not_cl_completed.patch
Type: application/octet-stream
Size: 1304 bytes
Desc: not_cl_completed.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080708/d9d85b59/attachment.obj>


More information about the ofw mailing list