From 327cf9fd1001f9bd4df1159084f091ca384d804d Mon Sep 17 00:00:00 2001 From: Jay Ding Date: Mon, 30 Apr 2018 18:06:12 -0700 Subject: [PATCH] net/bnxt: return error in stats if init is not complete return error if init is not complete before accessing stats. Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats") Cc: stable@dpdk.org Signed-off-by: Jay Ding Signed-off-by: Scott Branden Reviewed-by: Ajit Khaparde Reviewed-by: Randy Schacher Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c index 1b586f3336..c1a8fad09e 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -210,7 +210,7 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, memset(bnxt_stats, 0, sizeof(*bnxt_stats)); if (!(bp->flags & BNXT_FLAG_INIT_DONE)) { PMD_DRV_LOG(ERR, "Device Initialization not complete!\n"); - return 0; + return -1; } for (i = 0; i < bp->rx_cp_nr_rings; i++) { -- 2.20.1