summaryrefslogtreecommitdiffstats
path: root/fs/proc/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 03:20:14 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 20:13:14 +0200
commitb6cdc7310338e204224f865918f774eb6db0b75d (patch)
tree0525092aeb3cc02dbe67b41444444cfc7cd4449a /fs/proc/inode.c
parenti2o: use proc_remove_subtree() (diff)
downloadlinux-b6cdc7310338e204224f865918f774eb6db0b75d.tar.xz
linux-b6cdc7310338e204224f865918f774eb6db0b75d.zip
procfs: don't allow to use proc_create, create_proc_entry, etc. for directories
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r--fs/proc/inode.c4
1 files changed, 2 insertions, 2 deletions
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