diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 117edf89e67d..e80961dfc29d 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -377,8 +377,12 @@ static struct vfsmount *fuse_dentry_automount(struct path *path) /* Initialize superblock, making @mp_fi its root */ err = fuse_fill_super_submount(sb, mp_fi); - if (err) + if (err) { + fuse_conn_put(fc); + kfree(fm); + sb->s_fs_info = NULL; goto out_put_sb; + } sb->s_flags |= SB_ACTIVE; fsc->root = dget(sb->s_root);