Skip to content

Commit 12bac0d

Browse files
Alexey Dobriyantorvalds
authored andcommitted
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 <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e17a576 commit 12bac0d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/proc/generic.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,10 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
312312
if (proc_match(len, cp, de))
313313
break;
314314
}
315-
if (!de)
315+
if (!de) {
316+
WARN(1, "name '%s'\n", name);
316317
return -ENOENT;
318+
}
317319
cp += len + 1;
318320
}
319321
*residual = cp;
@@ -818,8 +820,10 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
818820
}
819821
}
820822
spin_unlock(&proc_subdir_lock);
821-
if (!de)
823+
if (!de) {
824+
WARN(1, "name '%s'\n", name);
822825
return;
826+
}
823827

824828
spin_lock(&de->pde_unload_lock);
825829
/*

0 commit comments

Comments
 (0)