Skip to content

Commit a35dd3a

Browse files
t-8chJoelgranados
authored andcommitted
sysctl: drop now unnecessary out-of-bounds check
Remove the now unneeded check for ctl_table_size; it is safe to do so as sysctl_set_perm_empty_ctl_header() does not access the ctl_table member anymore. This also makes the element of sysctl_mount_point unnecessary, so drop it at the same time. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Joel Granados <j.granados@samsung.com>
1 parent 4a7b29f commit a35dd3a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/proc/proc_sysctl.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ static const struct file_operations proc_sys_dir_file_operations;
3030
static const struct inode_operations proc_sys_dir_operations;
3131

3232
/* Support for permanently empty directories */
33-
static struct ctl_table sysctl_mount_point[] = {
34-
{ }
35-
};
33+
static struct ctl_table sysctl_mount_point[] = { };
3634

3735
/**
3836
* register_sysctl_mount_point() - registers a sysctl mount point
@@ -232,8 +230,7 @@ static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header)
232230
return -EROFS;
233231

234232
/* Am I creating a permanently empty directory? */
235-
if (header->ctl_table_size > 0 &&
236-
sysctl_is_perm_empty_ctl_header(header)) {
233+
if (sysctl_is_perm_empty_ctl_header(header)) {
237234
if (!RB_EMPTY_ROOT(&dir->root))
238235
return -EINVAL;
239236
sysctl_set_perm_empty_ctl_header(dir_h);

0 commit comments

Comments
 (0)