git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0392531
)
vhost: fix slave request fd leak
author
Tiwei Bie
<tiwei.bie@intel.com>
Thu, 5 Sep 2019 11:01:25 +0000
(19:01 +0800)
committer
Ferruh Yigit
<ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:53 +0000
(15:00 +0200)
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>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost_user.c
patch
|
blob
|
history
diff --git
a/lib/librte_vhost/vhost_user.c
b/lib/librte_vhost/vhost_user.c
index
0b72648
..
f468436
100644
(file)
--- 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;