]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: Fix null pointer check in cifs_read
authorSteve French <stfrench@microsoft.com>
Wed, 13 May 2020 15:27:16 +0000 (10:27 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:23:10 +0000 (08:23 +0200)
[ Upstream commit 9bd21d4b1a767c3abebec203342f3820dcb84662 ]

Coverity scan noted a redundant null check

Coverity-id: 728517
Reported-by: Coverity <scan-admin@coverity.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Shyam Prasad N <nspmangalore@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/file.c

index 5920820bfbd0770be0bc18223ba9c31367f0a2da..b30b03747dd658076e3c789b9c828e7d9bfce0fc 100644 (file)
@@ -4060,7 +4060,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);