[PATCH 0/3] Trivial code clean for procfs

September 03rd, 2012 - 10:20 am ET by yan | Report spam
yan (3):
proc: return -ENOMEM when inode allocation failed
proc: no need to initialize proc_inode->fd in proc_get_inode
proc: use kzalloc instead of kmalloc and memset

fs/proc/generic.c | 5 ++
fs/proc/inode.c | 1 -
2 files changed, 2 insertions(+), 4 deletions(-)

1.7.9.5

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 11 repliesReplies Make a reply

Replies

#1 yan
September 03rd, 2012 - 10:20 am ET | Report spam
It has been initialized in proc_alloc_inode.

Signed-off-by: yan

fs/proc/inode.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 7ac817b..3b22bbd 100644
a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -450,7 +450,6 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
return NULL;
if (inode->i_state & I_NEW) {
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
- PROC_I(inode)->fd = 0;
PROC_I(inode)->pde = de;

if (de->mode) {
1.7.9.5

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Similar topics