From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Min Hu (Connor)" <humin29@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Yigit, Ferruh" <ferruh.yigit@intel.com>,
"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] net/virtio: fix getline memory leakage
Date: Wed, 28 Apr 2021 03:21:16 +0000 [thread overview]
Message-ID: <MN2PR11MB40634F55891470509EF08A0B9C409@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MN2PR11MB40639D548214148EB17B2A349C479@MN2PR11MB4063.namprd11.prod.outlook.com>
> -----Original Message-----
> From: stable <stable-bounces@dpdk.org> On Behalf Of Xia, Chenbo
> Sent: Wednesday, April 21, 2021 10:10 AM
> To: Min Hu (Connor) <humin29@huawei.com>; dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; maxime.coquelin@redhat.com;
> stable@dpdk.org
> Subject: Re: [dpdk-stable] [PATCH] net/virtio: fix getline memory leakage
>
> > -----Original Message-----
> > From: Min Hu (Connor) <humin29@huawei.com>
> > Sent: Wednesday, April 21, 2021 9:38 AM
> > To: dev@dpdk.org
> > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; maxime.coquelin@redhat.com; Xia,
> > Chenbo <chenbo.xia@intel.com>
> > Subject: [PATCH] net/virtio: fix getline memory leakage
> >
> > From: Chengwen Feng <fengchengwen@huawei.com>
> >
> > This patch fixes getline memory leakage when parsing dynamic major num.
> >
> > Fixes: 7d62bf6f54ba ("net/virtio: introduce vhost-vDPA backend type")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> > Signed-off-by: Min Hu (Connor) <humin29@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
prev parent reply other threads:[~2021-04-28 3:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1618969069-15304-1-git-send-email-humin29@huawei.com>
2021-04-21 2:10 ` Xia, Chenbo
2021-04-28 3:21 ` Xia, Chenbo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MN2PR11MB40634F55891470509EF08A0B9C409@MN2PR11MB4063.namprd11.prod.outlook.com \
--to=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=humin29@huawei.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).