summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatan Azrad <matan@mellanox.com>2019-11-12 08:47:39 +0000
committerDavid Marchand <david.marchand@redhat.com>2019-11-21 00:18:02 +0100
commit43d0e304980a1527bcac92dc679057b189e2545a (patch)
treebcdb2bf366ab1dd51a273ce652e032bc36435154
parentfd03a747b0c77a82b33104cef9d317882734e1ee (diff)
downloaddpdk-next-net-intel-43d0e304980a1527bcac92dc679057b189e2545a.zip
dpdk-next-net-intel-43d0e304980a1527bcac92dc679057b189e2545a.tar.gz
dpdk-next-net-intel-43d0e304980a1527bcac92dc679057b189e2545a.tar.xz
app/testpmd: fix invalid port detaching
The port was not validated before detaching. Ignore port detach operation when the port is not valid. Fixes: f8e5baa2662d ("app/testpmd: check not detaching device twice") Cc: stable@dpdk.org Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
-rw-r--r--app/test-pmd/testpmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 446da36..73ebf37 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2557,6 +2557,9 @@ detach_port_device(portid_t port_id)
printf("Removing a device...\n");
+ if (port_id_is_invalid(port_id, ENABLED_WARN))
+ return;
+
dev = rte_eth_devices[port_id].device;
if (dev == NULL) {
printf("Device already removed\n");