patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] vhost: fix slave request fd leak
@ 2019-09-05 11:01 Tiwei Bie
  2019-09-09 10:13 ` Maxime Coquelin
  2019-09-18 13:09 ` Maxime Coquelin
  0 siblings, 2 replies; 3+ messages in thread
From: Tiwei Bie @ 2019-09-05 11:01 UTC (permalink / raw)
  To: dev, maxime.coquelin, zhihong.wang; +Cc: stable

We need to close the old slave request fd if any first
before taking the new one.

Fixes: 275c3f944730 ("vhost: support slave requests channel")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 lib/librte_vhost/vhost_user.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 0b72648a5..f46843610 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1564,6 +1564,9 @@ vhost_user_set_req_fd(struct virtio_net **pdev, struct VhostUserMsg *msg,
 		return RTE_VHOST_MSG_RESULT_ERR;
 	}
 
+	if (dev->slave_req_fd >= 0)
+		close(dev->slave_req_fd);
+
 	dev->slave_req_fd = fd;
 
 	return RTE_VHOST_MSG_RESULT_OK;
-- 
2.17.1


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

* Re: [dpdk-stable] [PATCH] vhost: fix slave request fd leak
  2019-09-05 11:01 [dpdk-stable] [PATCH] vhost: fix slave request fd leak Tiwei Bie
@ 2019-09-09 10:13 ` Maxime Coquelin
  2019-09-18 13:09 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2019-09-09 10:13 UTC (permalink / raw)
  To: Tiwei Bie, dev, zhihong.wang; +Cc: stable



On 9/5/19 1:01 PM, Tiwei Bie wrote:
> We need to close the old slave request fd if any first
> before taking the new one.
> 
> Fixes: 275c3f944730 ("vhost: support slave requests channel")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>  lib/librte_vhost/vhost_user.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 0b72648a5..f46843610 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -1564,6 +1564,9 @@ vhost_user_set_req_fd(struct virtio_net **pdev, struct VhostUserMsg *msg,
>  		return RTE_VHOST_MSG_RESULT_ERR;
>  	}
>  
> +	if (dev->slave_req_fd >= 0)
> +		close(dev->slave_req_fd);
> +
>  	dev->slave_req_fd = fd;
>  
>  	return RTE_VHOST_MSG_RESULT_OK;
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

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

* Re: [dpdk-stable] [PATCH] vhost: fix slave request fd leak
  2019-09-05 11:01 [dpdk-stable] [PATCH] vhost: fix slave request fd leak Tiwei Bie
  2019-09-09 10:13 ` Maxime Coquelin
@ 2019-09-18 13:09 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2019-09-18 13:09 UTC (permalink / raw)
  To: Tiwei Bie, dev, zhihong.wang; +Cc: stable



On 9/5/19 1:01 PM, Tiwei Bie wrote:
> We need to close the old slave request fd if any first
> before taking the new one.
> 
> Fixes: 275c3f944730 ("vhost: support slave requests channel")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>  lib/librte_vhost/vhost_user.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 0b72648a5..f46843610 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -1564,6 +1564,9 @@ vhost_user_set_req_fd(struct virtio_net **pdev, struct VhostUserMsg *msg,
>  		return RTE_VHOST_MSG_RESULT_ERR;
>  	}
>  
> +	if (dev->slave_req_fd >= 0)
> +		close(dev->slave_req_fd);
> +
>  	dev->slave_req_fd = fd;
>  
>  	return RTE_VHOST_MSG_RESULT_OK;
> 

Applied to dpdk-next-virtio/master.

Thanks,
Maxime

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 11:01 [dpdk-stable] [PATCH] vhost: fix slave request fd leak Tiwei Bie
2019-09-09 10:13 ` Maxime Coquelin
2019-09-18 13:09 ` Maxime Coquelin

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://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/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


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