Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/file_table: fix adding missing kmemleak_not_leak()

Commit b42bc9a3c511 ("Fix regression due to "fs: move binfmt_misc sysctl
to its own file") fixed a regression, however it failed to add a
kmemleak_not_leak().

Fixes: b42bc9a3c511 ("Fix regression due to "fs: move binfmt_misc sysctl to its own file")
Reported-by: Tong Zhang <ztong0001@gmail.com>
Cc: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Luis Chamberlain and committed by
Linus Torvalds
a3580ac9 2dd3a8a1

+6 -2
+6 -2
fs/file_table.c
··· 27 27 #include <linux/task_work.h> 28 28 #include <linux/ima.h> 29 29 #include <linux/swap.h> 30 + #include <linux/kmemleak.h> 30 31 31 32 #include <linux/atomic.h> 32 33 ··· 120 119 static int __init init_fs_stat_sysctls(void) 121 120 { 122 121 register_sysctl_init("fs", fs_stat_sysctls); 123 - if (IS_ENABLED(CONFIG_BINFMT_MISC)) 124 - register_sysctl_mount_point("fs/binfmt_misc"); 122 + if (IS_ENABLED(CONFIG_BINFMT_MISC)) { 123 + struct ctl_table_header *hdr; 124 + hdr = register_sysctl_mount_point("fs/binfmt_misc"); 125 + kmemleak_not_leak(hdr); 126 + } 125 127 return 0; 126 128 } 127 129 fs_initcall(init_fs_stat_sysctls);