[dpdk-dev] [PATCH 2/2] sched: fix possible mem leak on initialize

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Thu Dec 20 20:09:04 CET 2018



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Tonghao Zhang
> Sent: Tuesday, December 11, 2018 2:54 AM
> To: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 2/2] sched: fix possible mem leak on initialize
> 
> ping
> On Wed, Nov 28, 2018 at 9:56 PM Tonghao Zhang
> <xiangxia.m.yue at gmail.com> wrote:
> >
> > In some case, we may create sched port dynamically,
> > if err when creating so memory will leak.
> >
> > Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
> > ---
> >  lib/librte_sched/rte_sched.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
> > index 17de6e6..a3adcca 100644
> > --- a/lib/librte_sched/rte_sched.c
> > +++ b/lib/librte_sched/rte_sched.c
> > @@ -724,6 +724,7 @@ struct rte_sched_port *
> >                                     bmp_mem_size);
> >         if (port->bmp == NULL) {
> >                 RTE_LOG(ERR, SCHED, "Bitmap init error\n");
> > +               rte_free(port);
> >                 return NULL;
> >         }
> >
> > --
> > 1.8.3.1
> >

Also fixed another identical issue in the same function.

Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>

Applied to next-qos tree, thanks!



More information about the dev mailing list