Cleanup: notifier syscalls: Remove useless zero-init of zeroed memory
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 1 Nov 2021 18:59:41 +0000 (14:59 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 1 Nov 2021 19:15:25 +0000 (15:15 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I30f1c97f3d8ca9f6d800c0407f8ef96d3199cf06

src/lttng-syscalls.c

index c68baab785b43aac6c1ae81a6d05c0af95a797f0..3133ec710556d53a344ee9dfe00f9d9d1b442126 100644 (file)
@@ -812,7 +812,6 @@ int lttng_syscalls_register_event_notifier(
 {
        struct lttng_event_notifier_group *group = event_notifier_enabler->group;
        struct lttng_kernel_syscall_table *syscall_table = &group->syscall_table;
-       unsigned int i;
        int ret = 0;
 
        wrapper_vmalloc_sync_mappings();
@@ -821,26 +820,12 @@ int lttng_syscalls_register_event_notifier(
                syscall_table->syscall_dispatch = kzalloc(sizeof(struct hlist_head) * sc_table.len, GFP_KERNEL);
                if (!syscall_table->syscall_dispatch)
                        return -ENOMEM;
-
-               /* Initialize all list_head */
-               for (i = 0; i < sc_table.len; i++)
-                       INIT_HLIST_HEAD(&syscall_table->syscall_dispatch[i]);
-
-               /* Init the unknown syscall notifier list. */
-               INIT_HLIST_HEAD(&syscall_table->unknown_syscall_dispatch);
        }
 
        if (!syscall_table->syscall_exit_dispatch) {
                syscall_table->syscall_exit_dispatch = kzalloc(sizeof(struct hlist_head) * sc_table.len, GFP_KERNEL);
                if (!syscall_table->syscall_exit_dispatch)
                        return -ENOMEM;
-
-               /* Initialize all list_head */
-               for (i = 0; i < sc_table.len; i++)
-                       INIT_HLIST_HEAD(&syscall_table->syscall_exit_dispatch[i]);
-
-               /* Init the unknown exit syscall notifier list. */
-               INIT_HLIST_HEAD(&syscall_table->unknown_syscall_exit_dispatch);
        }
 
 #ifdef CONFIG_COMPAT
@@ -848,13 +833,6 @@ int lttng_syscalls_register_event_notifier(
                syscall_table->compat_syscall_dispatch = kzalloc(sizeof(struct hlist_head) * compat_sc_table.len, GFP_KERNEL);
                if (!syscall_table->compat_syscall_dispatch)
                        return -ENOMEM;
-
-               /* Initialize all list_head */
-               for (i = 0; i < compat_sc_table.len; i++)
-                       INIT_HLIST_HEAD(&syscall_table->compat_syscall_dispatch[i]);
-
-               /* Init the unknown syscall notifier list. */
-               INIT_HLIST_HEAD(&syscall_table->compat_unknown_syscall_dispatch);
        }
 
        if (!syscall_table->compat_syscall_exit_dispatch) {
@@ -863,13 +841,6 @@ int lttng_syscalls_register_event_notifier(
                                        GFP_KERNEL);
                if (!syscall_table->compat_syscall_exit_dispatch)
                        return -ENOMEM;
-
-               /* Initialize all list_head */
-               for (i = 0; i < compat_sc_exit_table.len; i++)
-                       INIT_HLIST_HEAD(&syscall_table->compat_syscall_exit_dispatch[i]);
-
-               /* Init the unknown exit syscall notifier list. */
-               INIT_HLIST_HEAD(&syscall_table->compat_unknown_syscall_exit_dispatch);
        }
 #endif
 
This page took 0.027487 seconds and 4 git commands to generate.