]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nfs: nfs3acl: drop useless assignment in nfs3_get_acl()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Wed, 9 Apr 2025 20:36:33 +0000 (23:36 +0300)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 28 Apr 2025 03:25:44 +0000 (23:25 -0400)
In nfs3_get_acl(), the local variable status is assigned the result of
nfs_refresh_inode() inside the *switch* statement, but that value gets
overwritten in the next *if* statement's true branch and is completely
ignored if that branch isn't taken...

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Link: https://lore.kernel.org/r/c32dced7-a4fa-43c0-aafe-ef6c819c2f91@omp.ru
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs3acl.c

index 18d8f6529f615ef5b6dc1a5585ff582c49afd874..a126eb31f62fae9e7aa528c906746f89d1717173 100644 (file)
@@ -104,7 +104,7 @@ struct posix_acl *nfs3_get_acl(struct inode *inode, int type, bool rcu)
 
        switch (status) {
                case 0:
-                       status = nfs_refresh_inode(inode, res.fattr);
+                       nfs_refresh_inode(inode, res.fattr);
                        break;
                case -EPFNOSUPPORT:
                case -EPROTONOSUPPORT: