commit | 66ac9fe7bacf9fa76c472efc7a7aaa590c7bce6a | [log] [tgz] |
---|---|---|
author | David Sterba <dsterba@suse.com> | Tue Apr 26 16:03:57 2016 +0200 |
committer | David Sterba <dsterba@suse.com> | Fri May 06 15:22:49 2016 +0200 |
tree | 80dd3ffed00f80e51ae904db05bcfc660ac683af | |
parent | ee6111386a1b304f8bf589d36810d53e3b27ee20 [diff] [blame] |
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: David Sterba <dsterba@suse.com>
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 6a6bb60..3d14618 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c
@@ -377,6 +377,9 @@ 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;