Skip to content

Commit a3580ac

Browse files
mcgroftorvalds
authored andcommitted
fs/file_table: fix adding missing kmemleak_not_leak()
Commit b42bc9a ("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: b42bc9a ("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>
1 parent 2dd3a8a commit a3580ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/file_table.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/task_work.h>
2828
#include <linux/ima.h>
2929
#include <linux/swap.h>
30+
#include <linux/kmemleak.h>
3031

3132
#include <linux/atomic.h>
3233

@@ -119,8 +120,11 @@ static struct ctl_table fs_stat_sysctls[] = {
119120
static int __init init_fs_stat_sysctls(void)
120121
{
121122
register_sysctl_init("fs", fs_stat_sysctls);
122-
if (IS_ENABLED(CONFIG_BINFMT_MISC))
123-
register_sysctl_mount_point("fs/binfmt_misc");
123+
if (IS_ENABLED(CONFIG_BINFMT_MISC)) {
124+
struct ctl_table_header *hdr;
125+
hdr = register_sysctl_mount_point("fs/binfmt_misc");
126+
kmemleak_not_leak(hdr);
127+
}
124128
return 0;
125129
}
126130
fs_initcall(init_fs_stat_sysctls);

0 commit comments

Comments
 (0)