app/testpmd: fix variable use before null check
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 8 Apr 2019 09:46:39 +0000 (10:46 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 22 Apr 2019 22:15:10 +0000 (00:15 +0200)
commit17250a2affdf88557911bbff086a00d05960a7ca
tree2d373abafd1ba7da41bb4fe894f03accdbb0c995
parentf2088e785cca5d0d6471aaebe90c0f8dabc5d069
app/testpmd: fix variable use before null check

The value returned from rte_eth_dev_tx_offload_name() function is used
for string comparison before being checked for NULL. Move the NULL check
up to be done first.

Coverity issue: 279438
Fixes: c73a9071877a ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
app/test-pmd/cmdline.c