aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhengchao Shao <[email protected]>2022-08-31 04:14:52 +0000
committerPaolo Abeni <[email protected]>2022-09-01 11:32:26 +0000
commit4bf8594a8036f42ca7ece1bbdaf45b7954fb09e6 (patch)
treeac78fb7e825c54e0b6b72e73dd04318dc23fb81b
parentMerge branch 'rk3588-ethernet-support' (diff)
downloadkernel-4bf8594a8036f42ca7ece1bbdaf45b7954fb09e6.tar.gz
kernel-4bf8594a8036f42ca7ece1bbdaf45b7954fb09e6.zip
net: sched: gred: remove NULL check before free table->tab in gred_destroy()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
-rw-r--r--net/sched/sch_gred.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index 44af3b18eed9..a661b062cca8 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -908,10 +908,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);
}