lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1606571451-3655-1-git-send-email-jrdr.linux@gmail.com>
Date:   Sat, 28 Nov 2020 19:20:51 +0530
From:   Souptick Joarder <jrdr.linux@...il.com>
To:     bfields@...ldses.org, chuck.lever@...cle.com
Cc:     linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        Souptick Joarder <jrdr.linux@...il.com>
Subject: [PATCH] nfsd: Fix kernel test robot warning

Kernel test robot throws below warning -

>> fs/nfsd/nfs3xdr.c:299:6: warning: variable 'err' is used
>> uninitialized whenever 'if' condition is false
>> [-Wsometimes-uninitialized]
           if (!v4 || !inode->i_sb->s_export_op->fetch_iversion)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfsd/nfs3xdr.c:304:6: note: uninitialized use occurs here
           if (err) {
               ^~~
   fs/nfsd/nfs3xdr.c:299:2: note: remove the 'if' if its condition is
always true
           if (!v4 || !inode->i_sb->s_export_op->fetch_iversion)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfsd/nfs3xdr.c:293:12: note: initialize the variable 'err' to
silence this warning
           __be32 err;
                     ^
                      = 0
   1 warning generated.

Initialize err = 0 to silence this warning.

Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
---
 fs/nfsd/nfs3xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index abb1608..47aeaee 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -290,7 +290,7 @@ void fill_post_wcc(struct svc_fh *fhp)
 {
 	bool v4 = (fhp->fh_maxsize == NFS4_FHSIZE);
 	struct inode *inode = d_inode(fhp->fh_dentry);
-	__be32 err;
+	__be32 err = 0;
 
 	if (fhp->fh_post_saved)
 		printk("nfsd: inode locked twice during operation.\n");
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ