diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2017-02-24 18:00:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-24 20:46:56 -0500 |
commit | 738bc38d49e017fe7acb3596712518e22c225816 (patch) | |
tree | f588e6b4b3e74b3401516170a04e01f00fc74b65 /kernel/ksysfs.c | |
parent | 3e6daded1f51b79ff851b6c1e4b192f47ea3d063 (diff) |
kernel/ksysfs.c: add __ro_after_init to bin_attribute structure
The object notes_attr of type bin_attribute is not modified after
getting initailized by ksysfs_init. Apart from initialization in
ksysfs_init it is also passed as an argument to the function
sysfs_create_bin_file but this argument is of type const. Therefore,
add __ro_after_init to its declaration.
Link: http://lkml.kernel.org/r/1486839969-16891-1-git-send-email-bhumirks@gmail.com
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/ksysfs.c')
-rw-r--r-- | kernel/ksysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index ee1bc1bb8feb..0999679d6f26 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c | |||
@@ -195,7 +195,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj, | |||
195 | return count; | 195 | return count; |
196 | } | 196 | } |
197 | 197 | ||
198 | static struct bin_attribute notes_attr = { | 198 | static struct bin_attribute notes_attr __ro_after_init = { |
199 | .attr = { | 199 | .attr = { |
200 | .name = "notes", | 200 | .name = "notes", |
201 | .mode = S_IRUGO, | 201 | .mode = S_IRUGO, |