IB/hfi1: Only set fd pointer when base context is completely initialized
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Sat, 29 Jul 2017 15:43:32 +0000 (08:43 -0700)
committerDoug Ledford <dledford@redhat.com>
Mon, 31 Jul 2017 19:18:38 +0000 (15:18 -0400)
commite87473bc1b6c2cb08f1b760cfc8cd012822241a6
tree8580ea74fd8e68d9e8d778439c4d83f7aa99788d
parent96603ed865b3c5a9a0d1c9ed434661519d49fde3
IB/hfi1: Only set fd pointer when base context is completely initialized

The allocate_ctxt() function adds the context to the fd data structure.
Since the context is not completely initialized, this can cause confusion
as to whether the context is valid or not.

Move the fd reference from allocate_ctxt() to setup_base_ctxt().
Update the necessary functions to be aware of this move.

Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/file_ops.c
drivers/infiniband/hw/hfi1/user_exp_rcv.c
drivers/infiniband/hw/hfi1/user_exp_rcv.h
drivers/infiniband/hw/hfi1/user_sdma.c
drivers/infiniband/hw/hfi1/user_sdma.h