Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Christian Brauner and committed by
Linus Torvalds
6c7ca6a0 b7ce6fa9

+1 -1
+1 -1
fs/namespace.c
··· 180 180 static void mnt_ns_release(struct mnt_namespace *ns) 181 181 { 182 182 /* keep alive for {list,stat}mount() */ 183 - if (refcount_dec_and_test(&ns->passive)) { 183 + if (ns && refcount_dec_and_test(&ns->passive)) { 184 184 fsnotify_mntns_delete(ns); 185 185 put_user_ns(ns->user_ns); 186 186 kfree(ns);