patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] net/virtio_user: do not close invalid file descriptor
@ 2020-01-06 19:18 Stephen Hemminger
  2020-01-07  1:41 ` Tiwei Bie
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2020-01-06 19:18 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, jianfeng.tan, stable

Valgrind complains that virtio_user is calling close(-1).
Fix this by adding check in virtio that is similar to existing code.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")
Cc: jianfeng.tan@intel.com
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index ea016e85d8af..ffbaa75b7e83 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -537,7 +537,8 @@ virtio_user_dev_uninit(struct virtio_user_dev *dev)
 		close(dev->kickfds[i]);
 	}
 
-	close(dev->vhostfd);
+	if (dev->vhostfd >= 0)
+		close(dev->vhostfd);
 
 	if (dev->is_server && dev->listenfd >= 0) {
 		close(dev->listenfd);
-- 
2.20.1


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

* Re: [dpdk-stable] [PATCH] net/virtio_user: do not close invalid file descriptor
  2020-01-06 19:18 [dpdk-stable] [PATCH] net/virtio_user: do not close invalid file descriptor Stephen Hemminger
@ 2020-01-07  1:41 ` Tiwei Bie
  2020-01-09 15:51   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
  0 siblings, 1 reply; 3+ messages in thread
From: Tiwei Bie @ 2020-01-07  1:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, jianfeng.tan, stable

On Mon, Jan 06, 2020 at 11:18:37AM -0800, Stephen Hemminger wrote:
> Valgrind complains that virtio_user is calling close(-1).
> Fix this by adding check in virtio that is similar to existing code.
> 
> Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")
> Cc: jianfeng.tan@intel.com
> Cc: stable@dpdk.org
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/virtio_user: do not close invalid file descriptor
  2020-01-07  1:41 ` Tiwei Bie
@ 2020-01-09 15:51   ` " Maxime Coquelin
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2020-01-09 15:51 UTC (permalink / raw)
  To: Tiwei Bie, Stephen Hemminger; +Cc: dev, jianfeng.tan, stable



On 1/7/20 2:41 AM, Tiwei Bie wrote:
> On Mon, Jan 06, 2020 at 11:18:37AM -0800, Stephen Hemminger wrote:
>> Valgrind complains that virtio_user is calling close(-1).
>> Fix this by adding check in virtio that is similar to existing code.
>>
>> Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")
>> Cc: jianfeng.tan@intel.com
>> Cc: stable@dpdk.org
>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>> ---
>>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
> 
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 --
2020-01-06 19:18 [dpdk-stable] [PATCH] net/virtio_user: do not close invalid file descriptor Stephen Hemminger
2020-01-07  1:41 ` Tiwei Bie
2020-01-09 15:51   ` [dpdk-stable] [dpdk-dev] " 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