Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/sched: Remove redundant memset(0) call in reset_policy()

The call to nla_strscpy() already zero-pads the tail of the destination
buffer which makes the additional memset(0) call redundant. Remove it.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20250811164039.43250-1-thorsten.blum@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Thorsten Blum and committed by
Jakub Kicinski
b3ba7d92 86e3d52b

-1
-1
net/sched/act_simple.c
··· 72 72 d = to_defact(a); 73 73 spin_lock_bh(&d->tcf_lock); 74 74 goto_ch = tcf_action_set_ctrlact(a, p->action, goto_ch); 75 - memset(d->tcfd_defdata, 0, SIMP_MAX_DATA); 76 75 nla_strscpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA); 77 76 spin_unlock_bh(&d->tcf_lock); 78 77 if (goto_ch)