Skip to content

Commit d43be02

Browse files
Colin Ian Kinggregkh
authored andcommitted
fs/proc/generic.c: fix incorrect pde_is_permanent check
[ Upstream commit f4bf74d ] Currently the pde_is_permanent() check is being run on root multiple times rather than on the next proc directory entry. This looks like a copy-paste error. Fix this by replacing root with next. Addresses-Coverity: ("Copy-paste error") Link: https://lkml.kernel.org/r/20210318122633.14222-1-colin.king@canonical.com Fixes: d919b33 ("proc: faster open/read/close with "permanent" files") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Greg Kroah-Hartman <gregkh@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f89b408 commit d43be02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/proc/generic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ int remove_proc_subtree(const char *name, struct proc_dir_entry *parent)
754754
while (1) {
755755
next = pde_subdir_first(de);
756756
if (next) {
757-
if (unlikely(pde_is_permanent(root))) {
757+
if (unlikely(pde_is_permanent(next))) {
758758
write_unlock(&proc_subdir_lock);
759759
WARN(1, "removing permanent /proc entry '%s/%s'",
760760
next->parent->name, next->name);

0 commit comments

Comments
 (0)