Skip to contentSkip to conversation

NFS: Don't trace an uninitialised value

PATCH In review [email protected] 2 participants 2 messages Nov 5, 2021

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 NFS: Don't trace an uninitialised value

From: Trond Myklebust <[email protected]>

If fhandle is NULL or fattr is NULL, then 'error' is uninitialised.

---
 fs/nfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/dir.c +1 -1
index 8de99f426183..731d31015b6a 100644
@@ -1798,7 +1798,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
 	}
 	nfs_set_verifier(dentry, dir_verifier);
 out:
-	trace_nfs_lookup_exit(dir, dentry, flags, error);
+	trace_nfs_lookup_exit(dir, dentry, flags, PTR_ERR_OR_ZERO(res));
 	nfs_free_fattr(fattr);
 	nfs_free_fhandle(fhandle);
 	return res;
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Fri, Nov 05, 2021 at 12:38:52PM -0400, [email protected] wrote:

From: Trond Myklebust <[email protected]>

If fhandle is NULL or fattr is NULL, then 'error' is uninitialised.

Quoted 20 lines
---
 fs/nfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/dir.c +1 -1
index 8de99f426183..731d31015b6a 100644
@@ -1798,7 +1798,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
 	}
 	nfs_set_verifier(dentry, dir_verifier);
 out:
-	trace_nfs_lookup_exit(dir, dentry, flags, error);
+	trace_nfs_lookup_exit(dir, dentry, flags, PTR_ERR_OR_ZERO(res));
 	nfs_free_fattr(fattr);
 	nfs_free_fhandle(fhandle);
 	return res;
Signature · 1 line
2.33.1