hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/tools/perf/util/syscalltbl.c
....@@ -1,26 +1,18 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * System call table mapper
34 *
45 * (C) 2016 Arnaldo Carvalho de Melo <acme@redhat.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms and conditions of the GNU General Public License,
8
- * version 2, as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope it will be useful, but WITHOUT
11
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- * more details.
146 */
157
168 #include "syscalltbl.h"
179 #include <stdlib.h>
1810 #include <linux/compiler.h>
11
+#include <linux/zalloc.h>
1912
2013 #ifdef HAVE_SYSCALL_TABLE_SUPPORT
2114 #include <string.h>
2215 #include "string2.h"
23
-#include "util.h"
2416
2517 #if defined(__x86_64__)
2618 #include <asm/syscalls_64.c>
....@@ -87,6 +79,7 @@
8779
8880 qsort(tbl->syscalls.entries, nr_entries, sizeof(struct syscall), syscallcmp);
8981 tbl->syscalls.nr_entries = nr_entries;
82
+ tbl->syscalls.max_id = syscalltbl_native_max_id;
9083 return 0;
9184 }
9285
....@@ -149,7 +142,7 @@
149142
150143 struct syscalltbl *syscalltbl__new(void)
151144 {
152
- struct syscalltbl *tbl = malloc(sizeof(*tbl));
145
+ struct syscalltbl *tbl = zalloc(sizeof(*tbl));
153146 if (tbl)
154147 tbl->audit_machine = audit_detect_machine();
155148 return tbl;