pci: fix resource leak when secondary process mapping fails
authorTetsuya Mukawa <mukawa@igel.co.jp>
Thu, 16 Jun 2016 02:33:11 +0000 (11:33 +0900)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 20 Jun 2016 08:44:43 +0000 (10:44 +0200)
commit0463fc37aae9772ac4a8ee0f8b9f2b229f76c783
tree70f7e31b22bd1b4c57b5628c42411b596855c32a
parent3fe2e5fec82becd43b06fafbb5e7e48326f52468
pci: fix resource leak when secondary process mapping fails

This patch fixes resource leak of pci_uio_map_secondary().
If pci_map_resource() succeeds but mapped address is different from an
address primary process mapped, this should be error.
Then the addresses secondary process mapped should be freed.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
lib/librte_eal/common/eal_common_pci_uio.c