All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: sched: gred: remove NULL check before free table->tab in gred_destroy()
@ 2022-08-31  4:14 Zhengchao Shao
  2022-09-01 13:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Zhengchao Shao @ 2022-08-31  4:14 UTC (permalink / raw)
  To: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
	xiyou.wangcong, jiri
  Cc: weiyongjun1, yuehaibing, shaozhengchao

The kfree invoked by gred_destroy_vq checks whether the input parameter
is empty. Therefore, gred_destroy() doesn't need to check table->tab.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 net/sched/sch_gred.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index e7af53f607bb..48da8ac8419e 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -911,10 +911,9 @@ static void gred_destroy(struct Qdisc *sch)
 	struct gred_sched *table = qdisc_priv(sch);
 	int i;
 
-	for (i = 0; i < table->DPs; i++) {
-		if (table->tab[i])
-			gred_destroy_vq(table->tab[i]);
-	}
+	for (i = 0; i < table->DPs; i++)
+		gred_destroy_vq(table->tab[i]);
+
 	gred_offload(sch, TC_GRED_DESTROY);
 	kfree(table->opt);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: sched: gred: remove NULL check before free table->tab in gred_destroy()
  2022-08-31  4:14 [PATCH net-next] net: sched: gred: remove NULL check before free table->tab in gred_destroy() Zhengchao Shao
@ 2022-09-01 13:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-01 13:40 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
	xiyou.wangcong, jiri, weiyongjun1, yuehaibing

Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 31 Aug 2022 12:14:52 +0800 you wrote:
> The kfree invoked by gred_destroy_vq checks whether the input parameter
> is empty. Therefore, gred_destroy() doesn't need to check table->tab.
> 
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
>  net/sched/sch_gred.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Here is the summary with links:
  - [net-next] net: sched: gred: remove NULL check before free table->tab in gred_destroy()
    https://git.kernel.org/netdev/net-next/c/4bf8594a8036

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-01 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31  4:14 [PATCH net-next] net: sched: gred: remove NULL check before free table->tab in gred_destroy() Zhengchao Shao
2022-09-01 13:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.