From: Ajit Khaparde Date: Fri, 22 May 2020 21:27:31 +0000 (-0700) Subject: net/bnxt: fix crash during close X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=83b4bf39eca2549313a9edf2bc61c75caba39910;p=dpdk.git net/bnxt: fix crash during close We are freeing flow_stats a little early. This results in a segfault when the driver accesses the members during cleanup. Move the call to bnxt_free_flow_stats_info() to prevent this. Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index e635781097..e8b4c058a1 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -221,8 +221,6 @@ static void bnxt_free_cos_queues(struct bnxt *bp) static void bnxt_free_mem(struct bnxt *bp, bool reconfig) { - bnxt_free_flow_stats_info(bp); - bnxt_free_filter_mem(bp); bnxt_free_vnic_attributes(bp); bnxt_free_vnic_mem(bp); @@ -5613,6 +5611,7 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev) bnxt_uninit_ctx_mem(bp); bnxt_uninit_locks(bp); + bnxt_free_flow_stats_info(bp); rte_free(bp->ptp_cfg); bp->ptp_cfg = NULL; return rc;