From patchwork Mon Jul 19 20:15:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 112792 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6JKFT9C019466 for ; Mon, 19 Jul 2010 20:15:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966662Ab0GSUP3 (ORCPT ); Mon, 19 Jul 2010 16:15:29 -0400 Received: from sj-iport-4.cisco.com ([171.68.10.86]:3585 "EHLO sj-iport-4.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966657Ab0GSUP2 (ORCPT ); Mon, 19 Jul 2010 16:15:28 -0400 Authentication-Results: sj-iport-4.cisco.com; dkim=neutral (message not signed) header.i=none X-IronPort-AV: E=Sophos;i="4.55,228,1278288000"; d="scan'208";a="160766987" Received: from sj-core-4.cisco.com ([171.68.223.138]) by sj-iport-4.cisco.com with ESMTP; 19 Jul 2010 20:15:27 +0000 Received: from roland-alpha.cisco.com (roland-alpha.cisco.com [10.33.42.9]) by sj-core-4.cisco.com (8.13.8/8.14.3) with ESMTP id o6JKFR7U023724; Mon, 19 Jul 2010 20:15:27 GMT Received: by roland-alpha.cisco.com (Postfix, from userid 33217) id 84A1520621; Mon, 19 Jul 2010 13:15:24 -0700 (PDT) From: Roland Dreier To: Dan Carpenter Cc: Steve Wise , Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch 2/2] infiniband/cxgb4: add null check References: <20100531140152.GU5483@bicker> X-Message-Flag: Warning: May contain useful information Date: Mon, 19 Jul 2010 13:15:24 -0700 In-Reply-To: <20100531140152.GU5483@bicker> (Dan Carpenter's message of "Mon, 31 May 2010 16:01:52 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 19 Jul 2010 20:15:30 +0000 (UTC) diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index b5e676c..4185c3b 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c @@ -780,11 +780,11 @@ static void connect_reply_upcall(struct c4iw_ep *ep, int status) event.private_data_len = ep->plen; event.private_data = ep->mpa_pkt + sizeof(struct mpa_message); } - if (ep->com.cm_id) { - PDBG("%s ep %p tid %u status %d\n", __func__, ep, - ep->hwtid, status); - ep->com.cm_id->event_handler(ep->com.cm_id, &event); - } + + PDBG("%s ep %p tid %u status %d\n", __func__, ep, + ep->hwtid, status); + ep->com.cm_id->event_handler(ep->com.cm_id, &event); + if (status < 0) { ep->com.cm_id->rem_ref(ep->com.cm_id); ep->com.cm_id = NULL;