Re: [PATCH net] net/sched: sch_taprio: reset child qdiscs before freeing them
From: Jakub Kicinski <kuba@kernel.org> Date: 2020-12-17 19:06:14
On Wed, 16 Dec 2020 19:33:29 +0100 Davide Caratti wrote:
+ if (q->qdiscs) {
+ for (i = 0; i < dev->num_tx_queues && q->qdiscs[i]; i++)
+ qdisc_reset(q->qdiscs[i]);
Are you sure that we can't graft a NULL in the middle of the array?
Shouldn't this be:
for (i = 0; i < dev->num_tx_queues; i++)
if (q->qdiscs[i])
qdisc_reset(q->qdiscs[i]);
?
If this is a problem it already exists in destroy so I'll apply anyway.