Skip to content

Commit

Permalink
posix-timers: Drop redundant memset() invocation
Browse files Browse the repository at this point in the history
Initially in commit 6891c45 memset() was required to clear a variable
allocated on stack. Commit 2482097 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
  • Loading branch information
Cyrill Gorcunov authored and Thomas Gleixner committed Mar 17, 2025
1 parent 8e63360 commit d1c3a3f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion kernel/time/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit d1c3a3f

Please sign in to comment.