pci: fix resource release when unmapping

This patch fixes wrong resource release of pci_uio_unmap().
The 'path' member of mapped_pci_resource structure is allocated by
primary process, but currently it will be freed by both primary
and secondary process.
The patch fixes to be freed by only primary process.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
This commit is contained in:
Tetsuya Mukawa 2016-06-16 11:33:10 +09:00 committed by Thomas Monjalon
parent 0463fc37aa
commit 3f0339efc1

View File

@ -169,7 +169,8 @@ pci_uio_unmap(struct mapped_pci_resource *uio_res)
for (i = 0; i != uio_res->nb_maps; i++) {
pci_unmap_resource(uio_res->maps[i].addr,
(size_t)uio_res->maps[i].size);
rte_free(uio_res->maps[i].path);
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
rte_free(uio_res->maps[i].path);
}
}