Skip to content

Commit 7a7a345

Browse files
Yang XiuweiAnna Schumaker
authored andcommitted
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: e96f926 ("NFS: Make all of /sys/fs/nfs network-namespace unique") Signed-off-by: Yang Xiuwei <[email protected]> Reviewed-by: Benjamin Coddington <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 85d2c23 commit 7a7a345

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/nfs/sysfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ static struct nfs_netns_client *nfs_netns_client_alloc(struct kobject *parent,
189189
return p;
190190

191191
kobject_put(&p->kobject);
192+
kobject_put(&p->nfs_net_kobj);
192193
}
193194
return NULL;
194195
}

0 commit comments

Comments
 (0)