> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: Tuesday, March 1, 2022 5:08 PM
> To: Weiguo Li <liw...@foxmail.com>
> Cc: Dumitrescu, Cristian <cristian.dumitre...@intel.com>; Singh, Jasvinder
> <jasvinder.si...@intel.com>; wojciechx.liguzin...@intel.com; dev@dpdk.org
> Subject: Re: [PATCH v3] sched: remove useless malloc in pie data init
> 
> On Tue,  1 Mar 2022 14:07:56 +0800
> Weiguo Li <liw...@foxmail.com> wrote:
> 
> > 'rte_pie_rt_data_init(NULL)' is not expected, and it's ought to
> > fail when this happen. The malloc inside the function didn't work.
> > So remove the malloc otherwise will lead to a memory leak.
> >
> > Fixes: 44c730b0e37971 ("sched: add PIE based congestion management")
> >
> > Signed-off-by: Weiguo Li <liw...@foxmail.com>
> 
> Acked-by: Stephen Hemminger <step...@networkplumber.org>

Hi Li,

I suggest you also replace all the assignments to zero in this function with a 
memset(0) of the entire structure. I see we set all fields to zero by direct 
assignment, with the exception of qlen_bytes, which looks like another small 
issue to me that we could fix here. The memset(0) should work even if later on 
we might need to set some fields to a non-zero value, as this can be done 
immediately after the memset(0). Ok with you?

Acked-by: Cristian Dumitrescu <cristian.dumitre...@intel.com>

Reply via email to