* [dpdk-dev] [PATCH] examples/bbdev: fix unchecked return value
@ 2018-01-31 14:40 Amr Mokhtar
2018-01-31 17:31 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: Amr Mokhtar @ 2018-01-31 14:40 UTC (permalink / raw)
To: dev; +Cc: Amr Mokhtar
Added a check on rte_bbdev_stats_get() return before
printing out the statistics results.
Coverity issue: 257018
Fixes: 1ffee690eaa1 ("examples/bbdev: add sample app")
Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
---
examples/bbdev_app/main.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 2e5bd8c..2af3562 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -609,8 +609,16 @@ print_stats(struct stats_lcore_params *stats_lcore)
xstats[i].value);
}
+ ret = rte_bbdev_stats_get(bbdev_id, &bbstats);
+ if (ret < 0) {
+ free(xstats);
+ free(xstats_names);
+ rte_exit(EXIT_FAILURE,
+ "ERROR(%d): Failure to get BBDEV %u statistics\n",
+ ret, bbdev_id);
+ }
+
printf("\nBBDEV STATISTICS:\n=================\n");
- rte_bbdev_stats_get(bbdev_id, &bbstats);
printf("BBDEV %u: %s enqueue count:\t\t%"PRIu64"\n",
bbdev_id, stats_border,
bbstats.enqueued_count);
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-31 17:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 14:40 [dpdk-dev] [PATCH] examples/bbdev: fix unchecked return value Amr Mokhtar
2018-01-31 17:31 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).