vhost: fix slave request fd leak
We need to close the old slave request fd if any first
before taking the new one.
Fixes: 275c3f9447
("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>
This commit is contained in:
parent
039253166a
commit
761d57651c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user