mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
mount: handle NULL values in mnt_ns_release()
When calling in listmount() mnt_ns_release() may be passed a NULL pointer. Handle that case gracefully. Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
b7ce6fa90f
commit
6c7ca6a02f
@@ -180,7 +180,7 @@ static void mnt_ns_tree_add(struct mnt_namespace *ns)
|
||||
static void mnt_ns_release(struct mnt_namespace *ns)
|
||||
{
|
||||
/* keep alive for {list,stat}mount() */
|
||||
if (refcount_dec_and_test(&ns->passive)) {
|
||||
if (ns && refcount_dec_and_test(&ns->passive)) {
|
||||
fsnotify_mntns_delete(ns);
|
||||
put_user_ns(ns->user_ns);
|
||||
kfree(ns);
|
||||
|
||||
Reference in New Issue
Block a user