Skip to content

Commit

Permalink
app/testpmd: fix invalid port detaching
Browse files Browse the repository at this point in the history
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")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
  • Loading branch information
Matan Azrad authored and david-marchand committed Nov 20, 2019
1 parent fd03a74 commit 43d0e30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/test-pmd/testpmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 43d0e30

Please sign in to comment.