* [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, other threads:[~2020-01-09 15:51 UTC | newest]
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
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).