]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
NFSD: Remove redundant assignment to variable host_err
authorColin Ian King <colin.i.king@gmail.com>
Mon, 10 Oct 2022 20:24:23 +0000 (21:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:21 +0000 (16:19 +0200)
[ Upstream commit 69eed23baf877bbb1f14d7f4df54f89807c9ee2a ]

Variable host_err is assigned a value that is never read, it is being
re-assigned a value in every different execution path in the following
switch statement. The assignment is redundant and can be removed.

Cleans up clang-scan warning:
warning: Value stored to 'host_err' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/vfs.c

index 9215350ad095c61d9e391db5097192a001467d95..88a2ad962a0556cc213cc1c1701900e29e1f1a26 100644 (file)
@@ -1306,7 +1306,6 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
                iap->ia_mode &= ~current_umask();
 
        err = 0;
-       host_err = 0;
        switch (type) {
        case S_IFREG:
                host_err = vfs_create(&init_user_ns, dirp, dchild, iap->ia_mode, true);