ethdev: fix illegal port access
authorTetsuya Mukawa <mukawa@igel.co.jp>
Fri, 7 Aug 2015 09:21:26 +0000 (18:21 +0900)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 9 Aug 2015 17:48:12 +0000 (19:48 +0200)
commit5c11cefe0e2e03d5eef205dce0d6eb5c4fd340f9
treecaff400a0a7778746c1919fde804ddb158743d9d
parentcd10c42eb5bcdc9b8d6f91db5929ed0e54132181
ethdev: fix illegal port access

To obtain detachable flag, pci_drv is accessed in rte_eth_dev_is_detachable().
But pci_drv is only valid if port is enabled. Not to cause illegal access,
add rte_eth_dev_is_valid_port() before accessing.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
lib/librte_ether/rte_ethdev.c