> -----Original Message-----
> From: stable <stable-boun...@dpdk.org> On Behalf Of Xia, Chenbo
> Sent: Wednesday, April 21, 2021 10:10 AM
> To: Min Hu (Connor) <humi...@huawei.com>; dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yi...@intel.com>; maxime.coque...@redhat.com;
> sta...@dpdk.org
> Subject: Re: [dpdk-stable] [PATCH] net/virtio: fix getline memory leakage
> 
> > -----Original Message-----
> > From: Min Hu (Connor) <humi...@huawei.com>
> > Sent: Wednesday, April 21, 2021 9:38 AM
> > To: dev@dpdk.org
> > Cc: Yigit, Ferruh <ferruh.yi...@intel.com>; maxime.coque...@redhat.com; Xia,
> > Chenbo <chenbo....@intel.com>
> > Subject: [PATCH] net/virtio: fix getline memory leakage
> >
> > From: Chengwen Feng <fengcheng...@huawei.com>
> >
> > This patch fixes getline memory leakage when parsing dynamic major num.
> >
> > Fixes: 7d62bf6f54ba ("net/virtio: introduce vhost-vDPA backend type")
> > Cc: sta...@dpdk.org
> >
> > Signed-off-by: Chengwen Feng <fengcheng...@huawei.com>
> > Signed-off-by: Min Hu (Connor) <humi...@huawei.com>
> > ---
> >  drivers/net/virtio/virtio_user_ethdev.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/virtio/virtio_user_ethdev.c
> > b/drivers/net/virtio/virtio_user_ethdev.c
> > index 79bd31e..e85906e 100644
> > --- a/drivers/net/virtio/virtio_user_ethdev.c
> > +++ b/drivers/net/virtio/virtio_user_ethdev.c
> > @@ -360,7 +360,7 @@ vdpa_dynamic_major_num(void)
> >  {
> >     FILE *fp;
> >     char *line = NULL;
> > -   size_t size;
> > +   size_t size = 0;
> >     char name[11];
> >     bool found = false;
> >     uint32_t num;
> > @@ -380,6 +380,7 @@ vdpa_dynamic_major_num(void)
> >                     break;
> >             }
> >     }
> > +   free(line);
> >     fclose(fp);
> >     return found ? num : UNNAMED_MAJOR;
> >  }
> > --
> > 2.7.4

Applied to next-virtio/main, thanks

Reply via email to