Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66ac9fe7 authored by David Sterba's avatar David Sterba
Browse files

btrfs: add check to sysfs handler of label



Add a sanity check for the fs_info as we will dereference it, similar to
what the 'store features' handler does.

Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent ee611138
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -377,6 +377,9 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
	struct btrfs_fs_info *fs_info = to_fs_info(kobj);
	size_t p_len;

	if (!fs_info)
		return -EPERM;

	if (fs_info->sb->s_flags & MS_RDONLY)
		return -EROFS;