f0e1180cb6
rte_eth_dev_pci_release() function wrongly releases an ethdev port and then releases internal fields of this port. This behavior is problematic, because after the release, the port may be reallocated again by another thread or just be invalid for any usage. Move the release operation to the end of the function. Fixes: dcd5c8112bc3 ("ethdev: add PCI driver helpers") Cc: stable@dpdk.org Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>