diff options
author | Joel Granados <j.granados@samsung.com> | 2023-07-21 11:46:42 +0200 |
---|---|---|
committer | Joel Granados <j.granados@samsung.com> | 2024-04-08 10:07:03 +0200 |
commit | 887ec4e79b9e4e29d99a01c7f2665d5b236be459 (patch) | |
tree | 8b453847a3ab0d3b3458144dce70da65f5eca9f6 | |
parent | 71735b9a358a4aba47f943d114c8fecd8b3fffb2 (diff) | |
download | linux-jag/sysctl_remset.tar.gz |
sysctl: Warn on an empty procname elementjag/sysctl_remset
Add a pr_err warning in case developers use the old way of creating a
ctl_table array with an empty procname.
Signed-off-by: Joel Granados <j.granados@samsung.com>
-rw-r--r-- | fs/proc/proc_sysctl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 367db6988187b..237f679bbf3ea 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1122,6 +1122,8 @@ static int sysctl_check_table(const char *path, struct ctl_table_header *header) struct ctl_table *entry; int err = 0; list_for_each_table_entry(entry, header) { + if (!entry->procname) + err |= sysctl_err(path, entry, "procname is null"); if ((entry->proc_handler == proc_dostring) || (entry->proc_handler == proc_dobool) || (entry->proc_handler == proc_dointvec) || |