From 43d0e304980a1527bcac92dc679057b189e2545a Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Tue, 12 Nov 2019 08:47:39 +0000 Subject: [PATCH] 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 Acked-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 446da36234..73ebf37aae 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"); -- 2.20.1