[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aJqB3A8LMcocbfRT@MacBook-Air.local>
Date: Mon, 11 Aug 2025 16:50:52 -0700
From: Joe Damato <joe@...a.to>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Jamal Hadi Salim <jhs@...atatu.com>,
Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko <jiri@...nulli.us>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net/sched: Remove redundant memset(0) call in
reset_policy()
On Mon, Aug 11, 2025 at 06:40:38PM +0200, Thorsten Blum 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 <thorsten.blum@...ux.dev>
> ---
> net/sched/act_simple.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
> index f3abe0545989..8e69a919b4fe 100644
> --- a/net/sched/act_simple.c
> +++ b/net/sched/act_simple.c
> @@ -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)
Reviewed-by: Joe Damato <joe@...a.to>
Powered by blists - more mailing lists