From patchwork Tue Oct 6 21:13:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 52027 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 n96LJ04D031798 for ; Tue, 6 Oct 2009 21:19:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933285AbZJFVN7 (ORCPT ); Tue, 6 Oct 2009 17:13:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933406AbZJFVN7 (ORCPT ); Tue, 6 Oct 2009 17:13:59 -0400 Received: from smtp.opengridcomputing.com ([209.198.142.2]:52585 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933285AbZJFVN6 (ORCPT ); Tue, 6 Oct 2009 17:13:58 -0400 Received: from build.ogc.int (build.ogc.int [10.10.0.2]) by smtp.opengridcomputing.com (Postfix) with ESMTP id 39F217C785; Tue, 6 Oct 2009 21:35:22 -0500 (CDT) From: Steve Wise Subject: [PATCH] RDMA/cxgb3: iwch_query_port() - handle null inetdev ptr. To: rdreier@cisco.com Cc: linux-rdma@vger.kernel.org Date: Tue, 06 Oct 2009 16:13:22 -0500 Message-ID: <20091006211321.16751.15175.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 diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index 6895523..03cfaec 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c @@ -1199,11 +1199,14 @@ static int iwch_query_port(struct ib_device *ibdev, props->state = IB_PORT_DOWN; else { inetdev = in_dev_get(netdev); - if (inetdev->ifa_list) - props->state = IB_PORT_ACTIVE; - else + if (inetdev) { + if (inetdev->ifa_list) + props->state = IB_PORT_ACTIVE; + else + props->state = IB_PORT_INIT; + in_dev_put(inetdev); + } else props->state = IB_PORT_INIT; - in_dev_put(inetdev); } props->port_cap_flags =