net/ixgbe: fix crash on detach
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 31 May 2018 09:53:07 +0000 (10:53 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 2 Jul 2018 23:35:57 +0000 (01:35 +0200)
commitbeaa005850a27f6e83f30296c1d0893d1ff49925
tree8394237737996038bcf40da28add2de82c8d81af
parent5cffc8b28dc874d04df7675abf7187c271524f70
net/ixgbe: fix crash on detach

When detaching a port bound to ixgbe PMD, if the port
does not have any VFs, *vfinfo is not set and there is
a NULL dereference attempt, when calling
rte_eth_switch_domain_free(), which expects VFs to be used,
causing a segmentation fault.

Steps to reproduce:

./testpmd -- -i
testpmd> port stop all
testpmd> port close all
testpmd> port detach 0

Bugzilla ID: 57
Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
Cc: stable@dpdk.org
Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
drivers/net/ixgbe/ixgbe_pf.c