Skip to content

Commit

Permalink
RDMA/cxgb4: Don't use null ep ptr
Browse files Browse the repository at this point in the history
In c4iw_modify_qp() error path, only use qhp->ep if ep is not already set.
Otherwise qhp->ep can be NULL and we crash.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Steve Wise authored and Roland Dreier committed Sep 28, 2010
1 parent c8e081a commit af93fb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/infiniband/hw/cxgb4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,8 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,

/* disassociate the LLP connection */
qhp->attr.llp_stream_handle = NULL;
ep = qhp->ep;
if (!ep)
ep = qhp->ep;
qhp->ep = NULL;
qhp->attr.state = C4IW_QP_STATE_ERROR;
free = 1;
Expand Down

0 comments on commit af93fb5

Please sign in to comment.