[PATCH 2.6.37 01/11] RDMA/cxgb4: Don't use null ep ptr.

Steve Wise
2010-09-10T16:14:48Z

In c4iw_modify_qp() error path, only use qhp->ep if ep is not set. Otherwise
qhp->ep can be NULL and we crash.

Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---

drivers/infiniband/hw/cxgb4/qp.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 93f6e5b..05aa20b 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1305,7 +1305,8 @@ err:

/* 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;