mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
NFS: sysfs: fix leak when nfs_client kobject add fails
[ Upstream commit7a7a345652] If adding the second kobject fails, drop both references to avoid sysfs residue and memory leak. Fixes:e96f9268ee("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fc022d7d5b
commit
b03837f838
@@ -189,6 +189,7 @@ static struct nfs_netns_client *nfs_netns_client_alloc(struct kobject *parent,
|
||||
return p;
|
||||
|
||||
kobject_put(&p->kobject);
|
||||
kobject_put(&p->nfs_net_kobj);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user