Skip to content

Commit

Permalink
app/testpmd: fix invalid port detaching
Browse files Browse the repository at this point in the history
[ upstream commit 43d0e30 ]

The port was not validated before detaching.

Ignore port detach operation when the port is not valid.

Fixes: f8e5baa ("app/testpmd: check not detaching device twice")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
  • Loading branch information
Matan Azrad authored and kevintraynor committed Dec 11, 2019
1 parent bd979ff commit df025f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/test-pmd/testpmd.c
Expand Up @@ -2350,6 +2350,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");
Expand Down

0 comments on commit df025f6

Please sign in to comment.