Message ID | 1411465106-3117-1-git-send-email-ogerlitz@mellanox.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
> --- a/drivers/infiniband/core/uverbs_main.c > +++ b/drivers/infiniband/core/uverbs_main.c > @@ -502,6 +502,10 @@ void ib_uverbs_qp_event_handler(struct ib_event > *event, void *context_ptr) > { > struct ib_uevent_object *uobj; > > + /* for XRC target qp's, check that qp is live */ > + if (!event->element.qp->uobject || !event->element.qp->uobject->live) > + return; Isn't checking 'live' sufficient? - Sean -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 23 Sep 2014 15:55:14 +0000 "Hefty, Sean" <sean.hefty@intel.com> wrote: > > --- a/drivers/infiniband/core/uverbs_main.c > > +++ b/drivers/infiniband/core/uverbs_main.c > > @@ -502,6 +502,10 @@ void ib_uverbs_qp_event_handler(struct ib_event > > *event, void *context_ptr) > > { > > struct ib_uevent_object *uobj; > > > > + /* for XRC target qp's, check that qp is live */ > > + if (!event->element.qp->uobject > > || !event->element.qp->uobject->live) > > + return; > > Isn't checking 'live' sufficient? Unfortunately, not -- uobject might be NULL, in which case we will get a kernel Oops. However, checking that uobject is NULL alone is not sufficient -- it might not yet be live. -Jack -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> > > + /* for XRC target qp's, check that qp is live */ > > > + if (!event->element.qp->uobject > > > || !event->element.qp->uobject->live) > > > + return; > > > > Isn't checking 'live' sufficient? > > Unfortunately, not -- uobject might be NULL, in which case we will get > a kernel Oops. I see - thanks -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index c73b22a..bb6fea1 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -502,6 +502,10 @@ void ib_uverbs_qp_event_handler(struct ib_event *event, void *context_ptr) { struct ib_uevent_object *uobj; + /* for XRC target qp's, check that qp is live */ + if (!event->element.qp->uobject || !event->element.qp->uobject->live) + return; + uobj = container_of(event->element.qp->uobject, struct ib_uevent_object, uobject);