Skip to contentSkip to conversation

proc: fix incorrect pde_is_permanent check

PATCH Applied Colin King 2 participants 2 messages Mar 18, 2021

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 proc: fix incorrect pde_is_permanent check

From: Colin Ian King <[email protected]>

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")

Fixes d919b33dafb3 ("proc: faster open/read/close with "permanent" files")
---
 fs/proc/generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/generic.c +1 -1
index bc86aa87cc41..5600da30e289 100644
@@ -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);
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Colin King

From: Colin Ian King <[email protected]>

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")

Fixes d919b33dafb3 ("proc: faster open/read/close with "permanent" files")

---

Thanks! Seems very much like it.