Skip to content

Commit

Permalink
fuse: clean up error exits in fuse_fill_super()
Browse files Browse the repository at this point in the history
Instead of "goto err", return error directly, since there's no error
cleanup to do now.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
Miklos Szeredi committed Oct 21, 2021
1 parent 80019f1 commit 964d32e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,22 +1566,18 @@ static int fuse_fill_super(struct super_block *sb, struct fs_context *fsc)
* Require mount to happen from the same user namespace which
* opened /dev/fuse to prevent potential attacks.
*/
err = -EINVAL;
if ((ctx->file->f_op != &fuse_dev_operations) ||
(ctx->file->f_cred->user_ns != sb->s_user_ns))
goto err;
return -EINVAL;
ctx->fudptr = &ctx->file->private_data;

err = fuse_fill_super_common(sb, ctx);
if (err)
goto err;
return err;
/* file->private_data shall be visible on all CPUs after this */
smp_mb();
fuse_send_init(get_fuse_mount_super(sb));
return 0;

err:
return err;
}

/*
Expand Down

0 comments on commit 964d32e

Please sign in to comment.