提交 738bc38d 编写于 作者: B Bhumika Goyal 提交者: Linus Torvalds

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.comSigned-off-by: NBhumika Goyal <bhumirks@gmail.com>
Acked-by: NKees Cook <keescook@chromium.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 3e6daded
...@@ -195,7 +195,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj, ...@@ -195,7 +195,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj,
return count; return count;
} }
static struct bin_attribute notes_attr = { static struct bin_attribute notes_attr __ro_after_init = {
.attr = { .attr = {
.name = "notes", .name = "notes",
.mode = S_IRUGO, .mode = S_IRUGO,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册