net/virtio: fix crash on querying xstats
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 20 Jun 2016 10:43:32 +0000 (18:43 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 22 Jun 2016 07:47:12 +0000 (09:47 +0200)
commit7e1eb993f23fda1f91e3eca0327b0aa7821861df
treec3260842b4a858746f9d2e16eaf81bf0d4052cc0
parent2cdc118eef96d1c92c2ddae82dd4b04a30eb78e4
net/virtio: fix crash on querying xstats

Trying to access xstats_names after "if (xstats_names == NULL)" is
obviously wrong, which would result to a crash while running "show
port xstats 0" in testpmd with virtio PMD.

The fix is straightforward; just reverse the check.

Fixes: baf91c395b18 ("net/virtio: fetch extended statistics with integer ids")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_ethdev.c