diff options
author | Roland Dreier <rolandd@cisco.com> | 2005-10-30 20:50:04 +0300 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2005-10-31 18:10:32 +0300 |
commit | 7162a3e0db34e914a8bc5bf74bbae0b386310cf8 (patch) | |
tree | ffd7eba03f29dd2932dd32ac4adc2921bde7644b /drivers/infiniband/core/uverbs_main.c | |
parent | a20583a7c2e35d80b1dfc1f60c9729498838725e (diff) | |
download | linux-7162a3e0db34e914a8bc5bf74bbae0b386310cf8.tar.xz |
[IB] uverbs: Avoid NULL pointer deref on CQ async event
Userspace CQs that have no completion event channel attached end up
with their cq_context set to NULL. However, asynchronous events like
"CQ overrun" can still occur on such CQs, so add a uverbs_file member
to struct ib_ucq_object that we can follow to deliver these events.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_main.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 0eb38f479b39..e58a7b278a00 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -442,13 +442,10 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file, void ib_uverbs_cq_event_handler(struct ib_event *event, void *context_ptr) { - struct ib_uverbs_event_file *ev_file = context_ptr; - struct ib_ucq_object *uobj; + struct ib_ucq_object *uobj = container_of(event->element.cq->uobject, + struct ib_ucq_object, uobject); - uobj = container_of(event->element.cq->uobject, - struct ib_ucq_object, uobject); - - ib_uverbs_async_handler(ev_file->uverbs_file, uobj->uobject.user_handle, + ib_uverbs_async_handler(uobj->uverbs_file, uobj->uobject.user_handle, event->event, &uobj->async_list, &uobj->async_events_reported); |