[ofw] [PATCH] Don't return CL_COMPLETED for IRPs completed with an error status
Leonid Keller
leonid at mellanox.co.il
Wed Jul 9 05:28:06 PDT 2008
Applied in 1360. Thank you.
> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Fab Tillier
> Sent: Wednesday, July 09, 2008 3:26 AM
> To: ofw at lists.openfabrics.org
> Subject: [ofw] [PATCH] Don't return CL_COMPLETED for IRPs
> completed with an error status
>
> 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
>
More information about the ofw
mailing list