[IB] uverbs: Avoid NULL pointer deref on CQ async event
[deliverable/linux.git] / drivers / infiniband / core / uverbs_main.c
index 0eb38f479b3957c7294357a8a6356a8a053011e9..e58a7b278a00bf0ae47af52000286b743688e794 100644 (file)
@@ -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);
                                
This page took 0.023925 seconds and 5 git commands to generate.