On Sun, Mar 31, 2019 at 07:10:07PM +0300, Shamir Rabinovitch wrote: > +/* > + * NOTE: > + * > + * ocrdma_ucontext must be used here because this function is also > + * called from ocrdma_alloc_ucontext where ib_udata does not have > + * valid ib_ucontext pointer. ib_uverbs_get_context does not call > + * uobj_{alloc|get_xxx} helpers which are used to store the > + * ib_ucontext in uverbs_attr_bundle wrapping the ib_udata. so > + * ib_udata does NOT imply valid ib_ucontext here! > + */ > static int _ocrdma_alloc_pd(struct ocrdma_dev *dev, struct ocrdma_pd *pd, > struct ocrdma_ucontext *uctx, > struct ib_udata *udata) I think this is a mistake, the ib_uverbs_get_context should set the ucontext in the udata as well so we don't have to have special flows like this. Jason