From patchwork Sat Jun 19 17:08:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12333067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78849C2B9F4 for ; Sat, 19 Jun 2021 17:09:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54F9E61208 for ; Sat, 19 Jun 2021 17:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234881AbhFSRLL (ORCPT ); Sat, 19 Jun 2021 13:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234871AbhFSRLK (ORCPT ); Sat, 19 Jun 2021 13:11:10 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73AEFC061574 for ; Sat, 19 Jun 2021 10:08:58 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id k8so18515571lja.4 for ; Sat, 19 Jun 2021 10:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Ije9hIIW14I2rhdmQdSmC/4A92zmkuJmZTCYTGAlzEw=; b=JHHGi8rTTmpxjRs00hdFm+x+JCYeAXWLVIBgtkUWi+78aqoPri7yM/7dhvINFF/DBg yiZMv2qyrhK08NpNeJCR3iVS0WfmIhQSMLJ5Wei67NwATUW86HvJ46VHJ4UQeSCRbsr9 pTQUicy4HcQtPs1OSfVto7HdPKNfUzHDp6FYfYo3M82EXSlaz6ejNOoB/1itox7Z4Icl EROfRy3EDJS8Z4iK5S/Qbts232WKqABI8+Q8kH3ds7Xeg+NSq+YF7yNP3Pyy+x0qPCBP 28P+3TRqDJUsGcZhVCGYTiz0IExG2bZDF8LU3GHgIP1WcahgwOp40DVLOXh9bhiV3Sg/ eENw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Ije9hIIW14I2rhdmQdSmC/4A92zmkuJmZTCYTGAlzEw=; b=tnAMxIDwBjW8j4rr/i9dtBpsxseVidvUm53eKNcesb9kOasKk2jiap4LRe985NyGHZ mTSXBiKCxGsKjQVkMitU8ZYsSWP8xiZ86MMUDSnP1LPD1n5PzZU6POCE1oy6LNGnJAPJ 5haSkt0Cgl3vt3L2r/4F2pKWANk4L9ybLcIOGmNTG2FrwiZ2it27clOYI0+wTaYZeYi+ Cb/8z+Px4R+uKg1b6NBVj0VXC7kXZZ/gh4uwHNcmJUVAdgmFkknETeft7XMrTEXlSq3t Y7q2Bs/z1Cw5NRl+ofqRLen9MOwuc3zSfmD8OD59U9qUm4eOjSZctmdABl/3N8mJYOf3 kgiw== X-Gm-Message-State: AOAM531ON0f0MpcVlFMRYUh4RPiHTZkJFon0Iy20o68JH1SLqn+xEB+S aLkv19Vs6qv+7fH0m+/uHkbF2EggesB+fPyhWSVk/Tx5zZsaXw== X-Google-Smtp-Source: ABdhPJy3F2vFlKacaG3RFpLxRdPx92QzpSWRYgTkqpvRLYEl8e2Hwuy6w0uXO/tqtIEvR6foRo29G5BJp1OudDgbzeg= X-Received: by 2002:a05:651c:1697:: with SMTP id bd23mr14245916ljb.148.1624122536464; Sat, 19 Jun 2021 10:08:56 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Sat, 19 Jun 2021 12:08:45 -0500 Message-ID: Subject: [CIFS][PATCH] fix unneeded null check To: CIFS Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org tcon can not be null in SMB2_tcon function so the check is not relevant and removing it makes Coverity happy. From d2d6e8657d7eaed14cff869aec902ceb2320a668 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sat, 19 Jun 2021 12:01:37 -0500 Subject: [PATCH] cifs: fix unneeded null check tcon can not be null in SMB2_tcon function so the check is not relevant and removing it makes Coverity happy. Acked-by: Ronnie Sahlberg Addresses-Coverity: 13250131 ("Dereference before null check") Signed-off-by: Steve French --- fs/cifs/smb2pdu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 07c38eec3929..454586d4c0fb 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1793,10 +1793,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, rsp = (struct smb2_tree_connect_rsp *)rsp_iov.iov_base; trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc); if (rc != 0) { - if (tcon) { - cifs_stats_fail_inc(tcon, SMB2_TREE_CONNECT_HE); - tcon->need_reconnect = true; - } + cifs_stats_fail_inc(tcon, SMB2_TREE_CONNECT_HE); + tcon->need_reconnect = true; goto tcon_error_exit; } -- 2.30.2