Skip to content

Commit

Permalink
kernel/ksysfs.c: add __ro_after_init to bin_attribute structure
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Bhumika Goyal <[email protected]>
Acked-by: Kees Cook <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
goyalbhumika authored and torvalds committed Feb 25, 2017
1 parent 3e6dade commit 738bc38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/ksysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj,
return count;
}

static struct bin_attribute notes_attr = {
static struct bin_attribute notes_attr __ro_after_init = {
.attr = {
.name = "notes",
.mode = S_IRUGO,
Expand Down

0 comments on commit 738bc38

Please sign in to comment.