net/bnxt: fix a segfault during close
PATCH 1/1 net/bnxt: fix a segfault 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")
Signed-off-by Ajit Khaparde <[email protected]>
--- drivers/net/bnxt/bnxt_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +1 -2
@@ -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;
Signature · 1 line
2.21.1 (Apple Git-122.3)
Quoted 7 lines · Ajit Khaparde
We are freeing
flow_statsa little early. This results in a segfault when the driver accesses the members during cleanup. Move the call tobnxt_free_flow_stats_info()to prevent this.Fixes 02a95625fe9c ("net/bnxt: add flow stats in extended stats")Signed-off-by Ajit Khaparde <[email protected]>
Patch applied to dpdk-next-net-brcm.
Quoted 31 lines
--- drivers/net/bnxt/bnxt_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/bnxt/bnxt_ethdev.c +1
-2@@ -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;--
2.21.1 (Apple Git-122.3)