]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/sched: Remove redundant memset(0) call in reset_policy()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 11 Aug 2025 16:40:38 +0000 (18:40 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 Aug 2025 00:13:29 +0000 (17:13 -0700)
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>
net/sched/act_simple.c

index f3abe05459895661d9600f719379773a55a1c456..8e69a919b4fee094263a882e9b1b4a56857d14bf 100644 (file)
@@ -72,7 +72,6 @@ static int reset_policy(struct tc_action *a, const struct nlattr *defdata,
        d = to_defact(a);
        spin_lock_bh(&d->tcf_lock);
        goto_ch = tcf_action_set_ctrlact(a, p->action, goto_ch);
-       memset(d->tcfd_defdata, 0, SIMP_MAX_DATA);
        nla_strscpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
        spin_unlock_bh(&d->tcf_lock);
        if (goto_ch)