On Wed, Jun 15, 2005 at 12:44:08PM +0300, Michael S. Tsirkin wrote:
> In sdp_post_rdma_iocb_snk, if sdp_iocb_q_get_head returns NULL, iocb is then
> used without checking.

Michael,

  This is done in a number of places, and the check for NULL iocb should
not be necessary. Earlier in each function where it's done, we perform a
look at the head of the queue and only continue if there is an iocb at
the head of the queue:

        iocb = sdp_iocb_q_look(&conn->r_pend);

  The reason I did it this way is to avoid having to return the iocb back
into the same queue if it is not entirely consumed or on a recoverable
error, depending on the function. 

-Libor

> Index: sdp_recv.c
> ===================================================================
> --- sdp_recv.c        (revision 2608)
> +++ sdp_recv.c        (working copy)
> @@ -411,7 +411,7 @@ static int sdp_post_rdma_iocb_snk(struct
>        * queue IOCB
>        */
>       iocb = sdp_iocb_q_get_head(&conn->r_pend);
> -     if (result < 0) {
> +     if (!iocb) {
>               sdp_dbg_warn(conn, "read IOCB missing from pending table <%d>",
>                            sdp_iocb_q_size(&conn->r_pend));
>               goto release;
> 
> -- 
> MST
_______________________________________________
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to