From: Dmitry Mastykin Date: Wed, 22 May 2024 07:45:24 +0000 (+0300) Subject: NFSv4: Fix memory leak in nfs4_set_security_label X-Git-Tag: v6.10-rc4~27^2~8 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=aad11473f8f4be3df86461081ce35ec5b145ba68;p=linux-block.git 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 Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index c93c12063b3a..94c07875aa3f 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -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 */