Commit ffc40c64 authored by Steve Wise's avatar Steve Wise Committed by Roland Dreier

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: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 13a23933
...@@ -1034,6 +1034,7 @@ err3: ...@@ -1034,6 +1034,7 @@ err3:
err2: err2:
cxio_hal_destroy_ctrl_qp(rdev_p); cxio_hal_destroy_ctrl_qp(rdev_p);
err1: err1:
rdev_p->t3cdev_p->ulp = NULL;
list_del(&rdev_p->entry); list_del(&rdev_p->entry);
return err; return err;
} }
......
...@@ -165,10 +165,13 @@ static void close_rnic_dev(struct t3cdev *tdev) ...@@ -165,10 +165,13 @@ static void close_rnic_dev(struct t3cdev *tdev)
static void iwch_event_handler(struct t3cdev *tdev, u32 evt, u32 port_id) static void iwch_event_handler(struct t3cdev *tdev, u32 evt, u32 port_id)
{ {
struct cxio_rdev *rdev = tdev->ulp; struct cxio_rdev *rdev = tdev->ulp;
struct iwch_dev *rnicp = rdev_to_iwch_dev(rdev); struct iwch_dev *rnicp;
struct ib_event event; struct ib_event event;
u32 portnum = port_id + 1; u32 portnum = port_id + 1;
if (!rdev)
return;
rnicp = rdev_to_iwch_dev(rdev);
switch (evt) { switch (evt) {
case OFFLOAD_STATUS_DOWN: { case OFFLOAD_STATUS_DOWN: {
rdev->flags = CXIO_ERROR_FATAL; rdev->flags = CXIO_ERROR_FATAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment