diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-05-07 04:02:10 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-05-07 05:24:11 +0300 |
commit | f4bf74d82915708208bc9d0c9bd3f769f56bfbec (patch) | |
tree | b9e96cd6cfb66687f3e31979cc4e93a0b9c4d15e /fs/proc/generic.c | |
parent | 0214967a376d0726baf35cc2845a59ac17ef4db1 (diff) | |
download | linux-f4bf74d82915708208bc9d0c9bd3f769f56bfbec.tar.xz |
fs/proc/generic.c: fix incorrect pde_is_permanent check
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: d919b33dafb3 ("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>
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r-- | fs/proc/generic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index bc86aa87cc41..5600da30e289 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -756,7 +756,7 @@ int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) while (1) { next = pde_subdir_first(de); if (next) { - if (unlikely(pde_is_permanent(root))) { + if (unlikely(pde_is_permanent(next))) { write_unlock(&proc_subdir_lock); WARN(1, "removing permanent /proc entry '%s/%s'", next->parent->name, next->name); |