> From: Grant Grundler [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 03, 2005 10:56 AM > > On Wed, Aug 03, 2005 at 09:28:04AM -0700, Roland Dreier wrote: > > Feedback in the meantime appreciated, though... > ... > > if (!pd || pd->uobject->context != file->ucontext || > > !scq || scq->uobject->context != file->ucontext || > > - !rcq || rcq->uobject->context != file->ucontext) { > > + !rcq || rcq->uobject->context != file->ucontext || > > + (cmd.is_srq && (!srq || srq->uobject->context != file->ucontext))) { > > I think it's redudant to test cmd.is_srq. > srq is NULL if cmd.is_srq is not set. > ie !srq should short circuit the rest of the test. > > if idr_find() fails, I would expect it to return NULL.
If idr_find returns NULL when cmd.is_srq is non-zero, then the user passed an invalid parameter. Likewise, if the SRQ is not null, but its context doesn't match, that's also an invalid parameter. If cmd.is_srq is zero, then a NULL SRQ is perfectly fine, and there's no need to fail the call. That is, the check for (!srq || srq->uobject->context != file->ucontext) must only be performed if cmd.is_srq is non-zero. - Fab _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
