From: Jay Ding Date: Tue, 1 May 2018 01:06:12 +0000 (-0700) Subject: net/bnxt: return error in stats if init is not complete X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=327cf9fd1001f9bd4df1159084f091ca384d804d;p=dpdk.git 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 --- 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++) {