summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2021-07-26 16:22:55 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-12 13:32:27 +0200
commit0505f8c628b9e0aef0140d3590e993099425cbdc (patch)
treef404d4ac91edb60bb18d07551dc50446681d9a22
parentb092186eb9e689e56edecb32048bc51bc413f3c0 (diff)
downloadlinux-stable-0505f8c628b9e0aef0140d3590e993099425cbdc.tar.gz
linux-stable-0505f8c628b9e0aef0140d3590e993099425cbdc.tar.bz2
linux-stable-0505f8c628b9e0aef0140d3590e993099425cbdc.zip
smb3: rc uninitialized in one fallocate path
[ Upstream commit 5ad4df56cd2158965f73416d41fce37906724822 ] Clang detected a problem with rc possibly being unitialized (when length is zero) in a recently added fallocate code path. Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/cifs/smb2ops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 398c941e3897..f77156187a0a 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -3613,7 +3613,8 @@ static int smb3_simple_fallocate_write_range(unsigned int xid,
char *buf)
{
struct cifs_io_parms io_parms = {0};
- int rc, nbytes;
+ int nbytes;
+ int rc = 0;
struct kvec iov[2];
io_parms.netfid = cfile->fid.netfid;