Commit 4bf8594a authored by Zhengchao Shao's avatar Zhengchao Shao Committed by Paolo Abeni

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: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Link: https://lore.kernel.org/r/20220831041452.33026-1-shaozhengchao@huawei.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 2af39b99
...@@ -908,10 +908,9 @@ static void gred_destroy(struct Qdisc *sch) ...@@ -908,10 +908,9 @@ static void gred_destroy(struct Qdisc *sch)
struct gred_sched *table = qdisc_priv(sch); struct gred_sched *table = qdisc_priv(sch);
int i; int i;
for (i = 0; i < table->DPs; i++) { for (i = 0; i < table->DPs; i++)
if (table->tab[i])
gred_destroy_vq(table->tab[i]); gred_destroy_vq(table->tab[i]);
}
gred_offload(sch, TC_GRED_DESTROY); gred_offload(sch, TC_GRED_DESTROY);
kfree(table->opt); kfree(table->opt);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment