]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
posix-timers: Drop redundant memset() invocation
authorCyrill Gorcunov <gorcunov@gmail.com>
Sun, 16 Mar 2025 19:58:15 +0000 (22:58 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 17 Mar 2025 09:38:49 +0000 (10:38 +0100)
Initially in commit 6891c4509c79 memset() was required to clear a variable
allocated on stack. Commit 2482097c6c0f removed the on stack variable and
retained the memset() despite the fact that the memory is allocated via
kmem_cache_zalloc() and therefore zereoed already.

Drop the redundant memset().

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/Z9ctVxwaYOV4A2g4@grain
kernel/time/posix-timers.c

index 2ca1c55d38a2b226bc6d36d2f23a949dbee1f55e..bc0bdf40eb505aabeedb1965316b1cabd80c722d 100644 (file)
@@ -526,7 +526,6 @@ static int do_timer_create(clockid_t which_clock, struct sigevent *event,
        } else {
                new_timer->it_sigev_notify     = SIGEV_SIGNAL;
                new_timer->sigq.info.si_signo = SIGALRM;
-               memset(&new_timer->sigq.info.si_value, 0, sizeof(sigval_t));
                new_timer->sigq.info.si_value.sival_int = new_timer->it_id;
                new_timer->it_pid = get_pid(task_tgid(current));
        }