NFSv4: Fix memory leak in nfs4_set_security_label
Subsystems (2)
PATCH 1/1 NFSv4: Fix memory leak in nfs4_set_security_label
We leak nfs_fattr and nfs4_label every time we set a security xattr.
Signed-off-by Dmitry Mastykin <[email protected]>
--- fs/nfs/nfs4proc.c | 1 + 1 file changed, 1 insertion(+)
fs/nfs/nfs4proc.c +1 -0
@@ -6268,6 +6268,7 @@ nfs4_set_security_label(struct inode *inode, const void *buf, size_t buflen)if (status ==0 )nfs_setsecurity (inode, fattr); +nfs_free_fattr (fattr); return status; }#endif /* CONFIG_NFS_V4_SECURITY_LABEL */
Signature · 1 line
2.30.2
Quoted 22 lines · Dmitry Mastykin
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
We leak
nfs_fattrandnfs4_labelevery time we set a security xattr.Signed-off-by Dmitry Mastykin <[email protected]>---
fs/nfs/nfs4proc.c | 1 +1 file changed, 1 insertion(+)fs/nfs/nfs4proc.c +1
-0@@ -6268,6 +6268,7 @@ nfs4_set_security_label(struct inode *inode, const void *buf, size_t buflen) if (status == 0) nfs_setsecurity(inode, fattr); + nfs_free_fattr(fattr); return status; }
Quoted 4 lines
#endif /*
CONFIG_NFS_V4_SECURITY_LABEL*/
--
2.30.2
Thanks! For future reference, please note the section on indenting in the file Documentation/process/coding-style.rst as your patch above was whitespace-broken and so didn't apply cleanly.
Since this was just a 1-liner, I've fixed it up for now, so no need to resubmit.
Signature · 3 lines
Trond Myklebust Linux NFS client maintainer, Hammerspace [email protected]