projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee61113
)
btrfs: add check to sysfs handler of label
author
David Sterba
<dsterba@suse.com>
Tue, 26 Apr 2016 14:03:57 +0000
(16:03 +0200)
committer
David Sterba
<dsterba@suse.com>
Fri, 6 May 2016 13:22:49 +0000
(15:22 +0200)
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>
fs/btrfs/sysfs.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/btrfs/sysfs.c
b/fs/btrfs/sysfs.c
index 6a6bb600b1ff43375490980f4dfc46e4b16601c2..3d14618ce54be8f8c484010632aa275f2da46184 100644
(file)
--- a/
fs/btrfs/sysfs.c
+++ b/
fs/btrfs/sysfs.c
@@
-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;