projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2af39b9
)
net: sched: gred: remove NULL check before free table->tab in gred_destroy()
author
Zhengchao Shao
<shaozhengchao@huawei.com>
Wed, 31 Aug 2022 04:14:52 +0000
(12:14 +0800)
committer
Paolo Abeni
<pabeni@redhat.com>
Thu, 1 Sep 2022 11:32:26 +0000
(13:32 +0200)
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>
Link:
https://lore.kernel.org/r/20220831041452.33026-1-shaozhengchao@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/sched/sch_gred.c
patch
|
blob
|
history
diff --git
a/net/sched/sch_gred.c
b/net/sched/sch_gred.c
index 44af3b18eed901527bbc4e2a6e945ae3f54b0401..a661b062cca85431845ef3abf84205035d3029ae 100644
(file)
--- 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);
}