]> Gentwo Git Trees - linux/.git/commit
NFS: sysfs: fix leak when nfs_client kobject add fails
authorYang Xiuwei <yangxiuwei@kylinos.cn>
Thu, 30 Oct 2025 03:03:25 +0000 (11:03 +0800)
committerAnna Schumaker <anna.schumaker@oracle.com>
Mon, 10 Nov 2025 19:30:45 +0000 (14:30 -0500)
commit7a7a3456520b309a0bffa1d9d62bd6c9dcab89b3
tree5abe73523f554fafb9a515d311406e5391dec987
parent85d2c2392ac6348e1171d627497034a341a250c1
NFS: sysfs: fix leak when nfs_client kobject add fails

If adding the second kobject fails, drop both references to avoid sysfs
residue and memory leak.

Fixes: e96f9268eea6 ("NFS: Make all of /sys/fs/nfs network-namespace unique")
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Reviewed-by: Benjamin Coddington <ben.coddington@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/sysfs.c