From patchwork Tue Sep 8 21:30:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 46254 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n88LU9t6019277 for ; Tue, 8 Sep 2009 21:30:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751952AbZIHVaF (ORCPT ); Tue, 8 Sep 2009 17:30:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752175AbZIHVaF (ORCPT ); Tue, 8 Sep 2009 17:30:05 -0400 Received: from smtp.opengridcomputing.com ([209.198.142.2]:58143 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952AbZIHVaE (ORCPT ); Tue, 8 Sep 2009 17:30:04 -0400 Received: from build.ogc.int (build.ogc.int [10.10.0.2]) by smtp.opengridcomputing.com (Postfix) with ESMTP id D976F7C766; Tue, 8 Sep 2009 16:30:06 -0500 (CDT) From: Steve Wise Subject: [PATCH 2/2] RDMA/cxgb3: clean up properly on FW mismatch failures. To: rdreier@cisco.com Cc: linux-rdma@vger.kernel.org, general@lists.openfabrics.org Date: Tue, 08 Sep 2009 16:30:06 -0500 Message-ID: <20090908213006.15369.19707.stgit@build.ogc.int> In-Reply-To: <20090908213001.15369.15629.stgit@build.ogc.int> References: <20090908213001.15369.15629.stgit@build.ogc.int> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 with the ulp ptr is null in iwch_err_handler() Signed-off-by: Steve Wise --- drivers/infiniband/hw/cxgb3/cxio_hal.c | 1 + drivers/infiniband/hw/cxgb3/iwch.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c index 4dec515..68955f8 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.c +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c @@ -1034,6 +1034,7 @@ err3: err2: cxio_hal_destroy_ctrl_qp(rdev_p); err1: + rdev_p->t3cdev_p->ulp = (void *) NULL; list_del(&rdev_p->entry); return err; } diff --git a/drivers/infiniband/hw/cxgb3/iwch.c b/drivers/infiniband/hw/cxgb3/iwch.c index 5796170..3f0c99d 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) static void iwch_event_handler(struct t3cdev *tdev, u32 evt, u32 port_id) { struct cxio_rdev *rdev = tdev->ulp; - struct iwch_dev *rnicp = rdev_to_iwch_dev(rdev); + struct iwch_dev *rnicp; struct ib_event event; u32 portnum = port_id + 1; + if (!rdev) + return; + rnicp = rdev_to_iwch_dev(rdev); switch (evt) { case OFFLOAD_STATUS_DOWN: { rdev->flags = CXIO_ERROR_FATAL;