examples/ioat: handle error when querying number of stats
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 25 Nov 2019 15:36:20 +0000 (15:36 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 26 Nov 2019 16:26:08 +0000 (17:26 +0100)
commite1bc8c50fc2d2c962ce74ef8674336c571d9dba6
tree41360020ebcf5b3585e22b4b804f8f9944782688
parent92c981637ffcc785026f14edb886a94f46315e22
examples/ioat: handle error when querying number of stats

To get the amount of memory needed for stats, we call the xstats_get_names
function with a NULL parameter, which can return -1 on error. This negative
value was not previously handled correctly, so we adjust things to quit the
stats printing routine if this basic call fails.

Coverity issue: 350346
Fixes: 632bcd9b5d4f ("examples/ioat: print statistics")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
examples/ioat/ioatfwd.c