From patchwork Mon Jun 1 17:53:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 224927 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 83974C433E0 for ; Mon, 1 Jun 2020 18:51:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B9102074B for ; Mon, 1 Jun 2020 18:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037463; bh=rh/iTIyXUgQYbWqo2GeJdWBSVP/4pOsnGFMjLcnxaoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ASS/SzI4vz2VVGz275xl7EjJgiDjgw0fQ25TYijV+wgB+70J/+gWi5DCVc7obXdON 5GEhf70R4V1RnbQ70gbLomQ3AH4KzwJlls3/H6lLUqYqqaLz8LjA0ZJ0Gp80hr6W+2 hwfJUM2PW7t8jg2e3yyUPwpeDYVe/m13VugOi+G4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730563AbgFASvB (ORCPT ); Mon, 1 Jun 2020 14:51:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:50230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729201AbgFASFM (ORCPT ); Mon, 1 Jun 2020 14:05:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69D51207D0; Mon, 1 Jun 2020 18:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034711; bh=rh/iTIyXUgQYbWqo2GeJdWBSVP/4pOsnGFMjLcnxaoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w9ZuBt/LtMubeOixWUwfYSzCfCW/BFudQEQLTFMn4VhN2NCzYlHvqu3b2iS/ZGLLS 9GYd8+ZqHY+AfbqvGS3dJRIN+JTzgPmQFqILxIAPnWg3VJ2LAYDtDi2jY4v5ou49W4 NLP42eB7yWAHL4huCgK1uxtDZOz4GtTbNehNDj40= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Coverity , Steve French , Shyam Prasad N , Sasha Levin Subject: [PATCH 4.19 35/95] cifs: Fix null pointer check in cifs_read Date: Mon, 1 Jun 2020 19:53:35 +0200 Message-Id: <20200601174026.412759141@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174020.759151073@linuxfoundation.org> References: <20200601174020.759151073@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Steve French [ Upstream commit 9bd21d4b1a767c3abebec203342f3820dcb84662 ] Coverity scan noted a redundant null check Coverity-id: 728517 Reported-by: Coverity Signed-off-by: Steve French Reviewed-by: Shyam Prasad N Signed-off-by: Sasha Levin --- fs/cifs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index cfb0d91289ec..128cbd69911b 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -3532,7 +3532,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset) * than it negotiated since it will refuse the read * then. */ - if ((tcon->ses) && !(tcon->ses->capabilities & + if (!(tcon->ses->capabilities & tcon->ses->server->vals->cap_large_files)) { current_read_size = min_t(uint, current_read_size, CIFSMaxBufSize);