diff --git a/fs/namespace.c b/fs/namespace.c index e5240df614de..236482fd503f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -4343,8 +4343,11 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags, warn_mandlock(); newmount.mnt = vfs_create_mount(fc); - if (IS_ERR(newmount.mnt)) - return PTR_ERR(newmount.mnt); + if (IS_ERR(newmount.mnt)) { + ret = PTR_ERR(newmount.mnt); + newmount.mnt = NULL; + return ret; + } newmount.dentry = dget(fc->root); newmount.mnt->mnt_flags = mnt_flags;