From patchwork Fri Sep 7 06:51:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1420111 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id CC67BDF283 for ; Fri, 7 Sep 2012 06:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926Ab2IGGvY (ORCPT ); Fri, 7 Sep 2012 02:51:24 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:57148 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751136Ab2IGGvY (ORCPT ); Fri, 7 Sep 2012 02:51:24 -0400 Received: by qaas11 with SMTP id s11so1913741qaa.19 for ; Thu, 06 Sep 2012 23:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=hHZZiaeeXSFkvZX3lON2a69vI6FtID+gdhW4YRopyvw=; b=Hwows6V4a8jgD5QutbIE6Zs6UQWGjSirLpzmvKthuEvTs9q7QOnBt53RuhSGsTvohe C9Z9L0YrHXOYGtTWUH97k0W9PIr5jHJha/Qpbavy44MN+l+8myM47ITc/fAwcmzASG75 +l5PAQH/jELUlo7XyBVkZJgr5eKG347ip+7VQEg9UswoIqFMDmmOSOaHeTHduVASTZq+ yaLvhftqkB93Ln6WU/jyhOymWWf+wtBrw0QSB2JLwMnVd4RV4NSkbwA3pbvJh6PrmaD2 xCWQU96oZIkmhIgh51dlamMpVKPEX9jyx3gDgwqZ+AlRdKXjsak+FMrOUtp3/r7RpWr3 2/bg== MIME-Version: 1.0 Received: by 10.229.136.14 with SMTP id p14mr1459599qct.93.1347000683428; Thu, 06 Sep 2012 23:51:23 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 6 Sep 2012 23:51:23 -0700 (PDT) Date: Fri, 7 Sep 2012 14:51:23 +0800 Message-ID: Subject: [PATCH] RDMA/cxgb4: move the dereference below the NULL test From: Wei Yongjun To: swise@chelsio.com, roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com Cc: yongjun_wei@trendmicro.com.cn, linux-rdma@vger.kernel.org Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Wei Yongjun The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Steve Wise --- drivers/infiniband/hw/cxgb4/cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 51f4206..6cfd4d8 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c @@ -1361,11 +1361,11 @@ static int abort_rpl(struct c4iw_dev *dev, struct sk_buff *skb) struct tid_info *t = dev->rdev.lldi.tids; ep = lookup_tid(t, tid); - PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); if (!ep) { printk(KERN_WARNING MOD "Abort rpl to freed endpoint\n"); return 0; } + PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); mutex_lock(&ep->com.mutex); switch (ep->com.state) { case ABORTING: