Commit cdf7e8dd authored by Rui Xiang's avatar Rui Xiang Committed by Linus Torvalds

proc: set attributes of pde using accessor functions

Use existing accessors proc_set_user() and proc_set_size() to set
attributes.  Just a cleanup.
Signed-off-by: default avatarRui Xiang <rui.xiang@huawei.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9f6e963f
...@@ -49,8 +49,7 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) ...@@ -49,8 +49,7 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
setattr_copy(inode, iattr); setattr_copy(inode, iattr);
mark_inode_dirty(inode); mark_inode_dirty(inode);
de->uid = inode->i_uid; proc_set_user(de, inode->i_uid, inode->i_gid);
de->gid = inode->i_gid;
de->mode = inode->i_mode; de->mode = inode->i_mode;
return 0; return 0;
} }
......
...@@ -74,9 +74,9 @@ __proc_device_tree_add_prop(struct proc_dir_entry *de, struct property *pp, ...@@ -74,9 +74,9 @@ __proc_device_tree_add_prop(struct proc_dir_entry *de, struct property *pp,
return NULL; return NULL;
if (!strncmp(name, "security-", 9)) if (!strncmp(name, "security-", 9))
ent->size = 0; /* don't leak number of password chars */ proc_set_size(ent, 0); /* don't leak number of password chars */
else else
ent->size = pp->length; proc_set_size(ent, pp->length);
return ent; return ent;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment