aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ftrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/ftrace.c')
-rw-r--r--arch/x86/kernel/ftrace.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 3cff1214e176..9dbb527e1652 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -494,7 +494,7 @@ static struct syscall_metadata *find_syscall_meta(unsigned long *syscall)
494 494
495struct syscall_metadata *syscall_nr_to_meta(int nr) 495struct syscall_metadata *syscall_nr_to_meta(int nr)
496{ 496{
497 if (!syscalls_metadata || nr >= FTRACE_SYSCALL_MAX || nr < 0) 497 if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
498 return NULL; 498 return NULL;
499 499
500 return syscalls_metadata[nr]; 500 return syscalls_metadata[nr];
@@ -507,7 +507,7 @@ int syscall_name_to_nr(char *name)
507 if (!syscalls_metadata) 507 if (!syscalls_metadata)
508 return -1; 508 return -1;
509 509
510 for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { 510 for (i = 0; i < NR_syscalls; i++) {
511 if (syscalls_metadata[i]) { 511 if (syscalls_metadata[i]) {
512 if (!strcmp(syscalls_metadata[i]->name, name)) 512 if (!strcmp(syscalls_metadata[i]->name, name))
513 return i; 513 return i;
@@ -533,13 +533,13 @@ static int __init arch_init_ftrace_syscalls(void)
533 unsigned long **psys_syscall_table = &sys_call_table; 533 unsigned long **psys_syscall_table = &sys_call_table;
534 534
535 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * 535 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
536 FTRACE_SYSCALL_MAX, GFP_KERNEL); 536 NR_syscalls, GFP_KERNEL);
537 if (!syscalls_metadata) { 537 if (!syscalls_metadata) {
538 WARN_ON(1); 538 WARN_ON(1);
539 return -ENOMEM; 539 return -ENOMEM;
540 } 540 }
541 541
542 for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { 542 for (i = 0; i < NR_syscalls; i++) {
543 meta = find_syscall_meta(psys_syscall_table[i]); 543 meta = find_syscall_meta(psys_syscall_table[i]);
544 syscalls_metadata[i] = meta; 544 syscalls_metadata[i] = meta;
545 } 545 }