Message ID | CAH2r5mv-HDPQ0XUTsH8e8xVJtfgcB12i=Yk1RiHZo2EJUOQHFQ@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [SMB3] fix static analysis warning in smb3_simple_fallocate_write_range | expand |
Steve French <smfrench@gmail.com> writes: > 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> > Signed-off-by: Steve French <stfrench@microsoft.com> > > diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c > index 23d6f4d71649..2dfd0d8297eb 100644 > --- a/fs/cifs/smb2ops.c > +++ b/fs/cifs/smb2ops.c Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
From 53af3cc8f10f0a0356abd6676028e187ce507689 Mon Sep 17 00:00:00 2001 From: Steve French <stfrench@microsoft.com> Date: Mon, 26 Jul 2021 16:22:55 -0500 Subject: [PATCH] smb3: rc uninitialized in one fallocate path 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> Signed-off-by: Steve French <stfrench@microsoft.com> --- fs/cifs/smb2ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 23d6f4d71649..2dfd0d8297eb 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3617,7 +3617,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; -- 2.30.2
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> Signed-off-by: Steve French <stfrench@microsoft.com> io_parms.netfid = cfile->fid.netfid;