summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDarek Stojaczyk <dariusz.stojaczyk@intel.com>2018-10-25 12:49:10 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-10-29 01:59:48 +0100
commit88e2d78a20fae4cccde351e38e0b1ef534ad3302 (patch)
tree66d2305efb75c45e07298400aa66191b78871bb2 /lib
parent4f5519ed8349347f60a2c3a7e9016c5660a47d87 (diff)
downloaddpdk-88e2d78a20fae4cccde351e38e0b1ef534ad3302.zip
dpdk-88e2d78a20fae4cccde351e38e0b1ef534ad3302.tar.gz
dpdk-88e2d78a20fae4cccde351e38e0b1ef534ad3302.tar.xz
vfio: fix read of freed memory on getting container fd
We were reading some memory just after freeing it. Fixes: 83a73c5fef66 ("vfio: use generic multi-process channel") Cc: stable@dpdk.org Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_eal/linuxapp/eal/eal_vfio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index 7d5b964..13a8b18 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -1042,8 +1042,9 @@ rte_vfio_get_container_fd(void)
mp_rep = &mp_reply.msgs[0];
p = (struct vfio_mp_param *)mp_rep->param;
if (p->result == SOCKET_OK && mp_rep->num_fds == 1) {
+ vfio_container_fd = mp_rep->fds[0];
free(mp_reply.msgs);
- return mp_rep->fds[0];
+ return vfio_container_fd;
}
free(mp_reply.msgs);
}