diff options
author | Steve Wise <swise@opengridcomputing.com> | 2009-09-09 14:25:56 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-09-09 14:25:56 -0400 |
commit | ffc40c6433e763209d2b1ec5b1a9854eb3bcd61c (patch) | |
tree | 05e3ae0b2e1eb031849e8202d1b8a0ace0b22536 /drivers/infiniband | |
parent | 13a239330abdda5afcb1161fce68ec214af2cc90 (diff) |
RDMA/cxgb3: Clean up properly on FW mismatch failures
FW mismatches can cause a crash in the iw_cxgb3 event handler.
- NULL the t3cdev->ulp pointer on failures in cxio_rdev_open()
- Silently ignore events when the ulp ptr is NULL in iwch_err_handler()
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/cxio_hal.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c index 4dec515c676c..72ed3396b721 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.c +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c | |||
@@ -1034,6 +1034,7 @@ err3: | |||
1034 | err2: | 1034 | err2: |
1035 | cxio_hal_destroy_ctrl_qp(rdev_p); | 1035 | cxio_hal_destroy_ctrl_qp(rdev_p); |
1036 | err1: | 1036 | err1: |
1037 | rdev_p->t3cdev_p->ulp = NULL; | ||
1037 | list_del(&rdev_p->entry); | 1038 | list_del(&rdev_p->entry); |
1038 | return err; | 1039 | return err; |
1039 | } | 1040 | } |
diff --git a/drivers/infiniband/hw/cxgb3/iwch.c b/drivers/infiniband/hw/cxgb3/iwch.c index 5796170b0b25..3f0c99daae8c 100644 --- a/drivers/infiniband/hw/cxgb3/iwch.c +++ b/drivers/infiniband/hw/cxgb3/iwch.c | |||
@@ -165,10 +165,13 @@ static void close_rnic_dev(struct t3cdev *tdev) | |||
165 | static void iwch_event_handler(struct t3cdev *tdev, u32 evt, u32 port_id) | 165 | static void iwch_event_handler(struct t3cdev *tdev, u32 evt, u32 port_id) |
166 | { | 166 | { |
167 | struct cxio_rdev *rdev = tdev->ulp; | 167 | struct cxio_rdev *rdev = tdev->ulp; |
168 | struct iwch_dev *rnicp = rdev_to_iwch_dev(rdev); | 168 | struct iwch_dev *rnicp; |
169 | struct ib_event event; | 169 | struct ib_event event; |
170 | u32 portnum = port_id + 1; | 170 | u32 portnum = port_id + 1; |
171 | 171 | ||
172 | if (!rdev) | ||
173 | return; | ||
174 | rnicp = rdev_to_iwch_dev(rdev); | ||
172 | switch (evt) { | 175 | switch (evt) { |
173 | case OFFLOAD_STATUS_DOWN: { | 176 | case OFFLOAD_STATUS_DOWN: { |
174 | rdev->flags = CXIO_ERROR_FATAL; | 177 | rdev->flags = CXIO_ERROR_FATAL; |