aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2010-03-05 16:44:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:45 -0500
commit12bac0d9f4dbf3445a0319beee848d15fa32775e (patch)
tree4b712e05e785c010a31d12bb4a1f662173b9fcee
parente17a5765f20d1219c3f05eb17aab11671978e0ec (diff)
proc: warn on non-existing proc entries
* warn if creation goes on to non-existent directory * warn if removal goes on from non-existing directory * warn if non-existing proc entry is removed Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/proc/generic.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index ce2d9547770..08f4d71dacd 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -312,8 +312,10 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
312 if (proc_match(len, cp, de)) 312 if (proc_match(len, cp, de))
313 break; 313 break;
314 } 314 }
315 if (!de) 315 if (!de) {
316 WARN(1, "name '%s'\n", name);
316 return -ENOENT; 317 return -ENOENT;
318 }
317 cp += len + 1; 319 cp += len + 1;
318 } 320 }
319 *residual = cp; 321 *residual = cp;
@@ -818,8 +820,10 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
818 } 820 }
819 } 821 }
820 spin_unlock(&proc_subdir_lock); 822 spin_unlock(&proc_subdir_lock);
821 if (!de) 823 if (!de) {
824 WARN(1, "name '%s'\n", name);
822 return; 825 return;
826 }
823 827
824 spin_lock(&de->pde_unload_lock); 828 spin_lock(&de->pde_unload_lock);
825 /* 829 /*