Re: [PATCH] [v2] net: sched: gred: dynamically allocate tc_gred_qopt_offload

From: Eric Dumazet
Date: Tue Oct 19 2021 - 18:26:53 EST




On 10/19/21 12:15 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
>
> @@ -754,6 +759,10 @@ static int gred_init(struct Qdisc *sch, struct nlattr *opt,
> sch->limit = qdisc_dev(sch)->tx_queue_len
> * psched_mtu(qdisc_dev(sch));
>
> + table->opt = kzalloc(sizeof(table->opt), GFP_KERNEL);

sizeof(*table->opt) ?

> + if (!table->opt)
> + return -ENOMEM;
> +
> return gred_change_table_def(sch, tb[TCA_GRED_DPS], extack);
> }
>