From patchwork Mon May 31 14:01:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 103283 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4VE1PTP023606 for ; Mon, 31 May 2010 14:02:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754814Ab0EaOC1 (ORCPT ); Mon, 31 May 2010 10:02:27 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:56498 "EHLO mail-ew0-f216.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754772Ab0EaOC0 (ORCPT ); Mon, 31 May 2010 10:02:26 -0400 Received: by ewy8 with SMTP id 8so971721ewy.28 for ; Mon, 31 May 2010 07:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=Brp8e3i5Of05bNn4cu7Hf0IFZYQtJ9imupiaVrUWfB0=; b=lls3G/2/rvQ6o/BDNRT/u0NoTD2BGOjZ34ETd8JYEkpVqtB2DolSq6JmVXM81wlwwQ nlQEx2XKc+bRFiWN+OnLMNFeWroyip4cNNv7fwSmpVtUnaWjdXAaI1Xxpb9Qi5tM1B40 UyOYd3am+0nqTdqJzUJxTpaxGffa/2U0WK8yI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=b0dwA68Vs++qVA8qHjvUFM6zA4wNXlAXxRdJlaZig2yvkR1kQQ8B2zPFCEcL3kpFCY htguZDgATCV+muoQRbSNARgfbxVsesT2A0vdqxaT+FxKhbzShqMgTkPUHEO7HbSyWgj7 MDDE/lwB0Je1CrZE/d+yJV+2ShdKW6hKGftBs= Received: by 10.213.35.72 with SMTP id o8mr2263780ebd.51.1275314545130; Mon, 31 May 2010 07:02:25 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id 15sm3071062ewy.12.2010.05.31.07.02.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 31 May 2010 07:02:24 -0700 (PDT) Date: Mon, 31 May 2010 16:01:52 +0200 From: Dan Carpenter To: Steve Wise Cc: Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 2/2] infiniband/cxgb4: add null check Message-ID: <20100531140152.GU5483@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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, 31 May 2010 14:02:28 +0000 (UTC) diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 60b5beb..9d11946 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c @@ -786,7 +786,8 @@ static void connect_reply_upcall(struct c4iw_ep *ep, int 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); + if (ep->com.cm_id) + ep->com.cm_id->rem_ref(ep->com.cm_id); ep->com.cm_id = NULL; ep->com.qp = NULL; }