[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH2r5mv-HDPQ0XUTsH8e8xVJtfgcB12i=Yk1RiHZo2EJUOQHFQ@mail.gmail.com>
Date: Mon, 26 Jul 2021 16:30:36 -0500
From: Steve French <smfrench@...il.com>
To: CIFS <linux-cifs@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
ronnie sahlberg <ronniesahlberg@...il.com>
Subject: [PATCH][SMB3] fix static analysis warning in smb3_simple_fallocate_write_range
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@...el.com>
Signed-off-by: Steve French <stfrench@...rosoft.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
@@ -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;
--
Thanks,
Steve
View attachment "0001-smb3-rc-uninitialized-in-one-fallocate-path.patch" of type "text/x-patch" (929 bytes)
Powered by blists - more mailing lists