NFS: Don't trace an uninitialised value
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 5 Nov 2021 16:35:26 +0000 (12:35 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 5 Nov 2021 16:58:41 +0000 (12:58 -0400)
If fhandle is NULL or fattr is NULL, then 'error' is uninitialised.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
fs/nfs/dir.c

index 210c5945ac2bc96da43ffd8bd260f22edd6bd9c7..36cb1012c7e142228912d48e3c3889726092b866 100644 (file)
@@ -1814,7 +1814,7 @@ no_entry:
        }
        nfs_set_verifier(dentry, dir_verifier);
 out_label:
-       trace_nfs_lookup_exit(dir, dentry, flags, error);
+       trace_nfs_lookup_exit(dir, dentry, flags, PTR_ERR_OR_ZERO(res));
        nfs4_label_free(label);
 out:
        nfs_free_fattr(fattr);