patches for DPDK stable branches
 help / color / mirror / Atom feed
* Re: [dpdk-stable] [PATCH] net/virtio: fix getline memory leakage
       [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
  0 siblings, 1 reply; 2+ messages in thread
From: Xia, Chenbo @ 2021-04-21  2:10 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh, maxime.coquelin, stable

> -----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

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/virtio: fix getline memory leakage
  2021-04-21  2:10 ` [dpdk-stable] [PATCH] net/virtio: fix getline memory leakage Xia, Chenbo
@ 2021-04-28  3:21   ` Xia, Chenbo
  0 siblings, 0 replies; 2+ messages in thread
From: Xia, Chenbo @ 2021-04-28  3:21 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh, maxime.coquelin, stable

> -----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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-28  3:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1618969069-15304-1-git-send-email-humin29@huawei.com>
2021-04-21  2:10 ` [dpdk-stable] [PATCH] net/virtio: fix getline memory leakage Xia, Chenbo
2021-04-28  3:21   ` Xia, Chenbo

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git