From b6cdc7310338e204224f865918f774eb6db0b75d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 30 Mar 2013 21:20:14 -0400 Subject: procfs: don't allow to use proc_create, create_proc_entry, etc. for directories Signed-off-by: Al Viro --- fs/proc/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/proc/inode.c') diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 908e97457319..a4aaaeee3342 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -462,8 +462,8 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) inode->i_size = de->size; if (de->nlink) set_nlink(inode, de->nlink); - if (de->proc_iops) - inode->i_op = de->proc_iops; + WARN_ON(!de->proc_iops); + inode->i_op = de->proc_iops; if (de->proc_fops) { if (S_ISREG(inode->i_mode)) { #ifdef CONFIG_COMPAT -- cgit v1.2.3