net/sched: Remove redundant memset(0) call in reset_policy()
Subsystems (3)
PATCH 1/1 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.
--- net/sched/act_simple.c | 1 - 1 file changed, 1 deletion(-)
net/sched/act_simple.c +0 -1
@@ -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)
Signature · 1 line
2.50.1
Quoted 13 lines · Thorsten Blum
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 <[email protected]>--- net/sched/act_simple.c | 1 - 1 file changed, 1 deletion(-)net/sched/act_simple.c +0
-0
net/sched/act_simple.c static int reset_policy(struct tc_action *a, const struct nlattr *defdata, · line 77
Quoted 7 lines
net/sched/act_simple.c +0
-1@@ -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)
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 7 lines · On Mon, 11 Aug 2025 18:40:38 +0200 you wrote:
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 <[email protected]>--- net/sched/act_simple.c | 1 - 1 file changed, 1 deletion(-)
Here is the summary with links:
- [net-next] net/sched: Remove redundant memset(0) call in reset_policy()
https://git.kernel.org/netdev/net-next/c/b3ba7d929ce1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html