Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2039326imm; Fri, 7 Sep 2018 09:53:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY/8Xw03n+peT27kWIjp+MuLAdCRoXndRlDJ0aIy/3jFzGgv1/GxxQrxvgRythS41xdV8Mu X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr8896302plk.214.1536339182866; Fri, 07 Sep 2018 09:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536339182; cv=none; d=google.com; s=arc-20160816; b=t2ryOmq1ocp3+UGHaPYQPG8yCt3S5BQAczsQnY3b31CQ2FzEr2c9hdwTYklL9W+x4A 1KEFVaruND2rai/eEtObIhmhM/7qAU7WEyTxJ7VUma4yVm5hg2UQMxFG8flXCOZWmg+C HvGTPZe3HEvAWP7uWSS+Lilmsv4+N7aE2yubq9xjAZ8P3ffQVKsGiYp8//PWu2NYq+D+ CSJwdfa7gzIuNP7tsw8Fms8RCIubmAixUFm0b3pvAIHocxIIUuE+2fQHd73fe1RV1A+S X+FcZpz1yqX4/cefLDju82L94ivAYtTQg3ppyaeI/w89PWXLAlQCVVLjxIHdCaN28vR1 xHTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=j/88ET/TYOPXFf65pUM7Ik4O5A289PoRJv1yXi5BgEI=; b=mvdXcZPVY0+8jizziWyhYgZiqJOV8F0mN9XMLBIOjU8InIIXz0d6o71Tm9PNIutSRZ H5hs4BcZaqST5iNEZwqvEcjhHwLaCOw6aT3ei0kWPS0DKedUEEi7Qbm8CbKMrint0uZb wcf8lqelG5XCN4dgVgy6xTmIktfgE2+6Aqd3SUZrTa17N2c/rh8oM6Fwb6Wby2Ibdbdw did31lulLIShdztBLYsCh3ccE1X7IYgzndV9Lbda+BScHxC4kx22c1m2XB9I2bealCSb BlhUuY9gL26gscOwVuWUZ9L49E/8EdB9rzHSZd92ioVnxd0tdtgrmDdGtYeWN15vFJPr 5LCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16-v6si9286144pgc.82.2018.09.07.09.52.47; Fri, 07 Sep 2018 09:53:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbeIGVdC (ORCPT + 99 others); Fri, 7 Sep 2018 17:33:02 -0400 Received: from nautica.notk.org ([91.121.71.147]:38087 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbeIGVdA (ORCPT ); Fri, 7 Sep 2018 17:33:00 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 5C884C01B; Fri, 7 Sep 2018 18:51:13 +0200 (CEST) From: Dominique Martinet To: v9fs-developer@lists.sourceforge.net, Eric Van Hensbergen , Latchesar Ionkov Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Dominique Martinet Subject: [PATCH 2/4] 9p/rdma: remove useless check in cm_event_handler Date: Fri, 7 Sep 2018 18:50:55 +0200 Message-Id: <1536339057-21974-3-git-send-email-asmadeus@codewreck.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1536339057-21974-1-git-send-email-asmadeus@codewreck.org> References: <1536339057-21974-1-git-send-email-asmadeus@codewreck.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dominique Martinet the client c is always dereferenced to get the rdma struct, so c has to be a valid pointer at this point. Gcc would optimize that away but let's make coverity happy... Addresses-Coverity-ID: 102778 ("Dereference before null check") Signed-off-by: Dominique Martinet --- net/9p/trans_rdma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 9719bc4d9424..119103bfa82e 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -274,8 +274,7 @@ p9_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) case RDMA_CM_EVENT_DISCONNECTED: if (rdma) rdma->state = P9_RDMA_CLOSED; - if (c) - c->status = Disconnected; + c->status = Disconnected; break; case RDMA_CM_EVENT_TIMEWAIT_EXIT: -- 2.17.1