net/sfc: fix cleanup order of SW stats
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Tue, 28 Sep 2021 11:29:05 +0000 (14:29 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 Oct 2021 16:35:57 +0000 (18:35 +0200)
Fix cleanup order of SW stats structures to be reversed
to initialization order.

Fixes: fdd7719eb3c1 ("net/sfc: add xstats for Rx/Tx doorbells")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
drivers/net/sfc/sfc_sw_stats.c

index 108f301..c297bb8 100644 (file)
@@ -566,8 +566,7 @@ sfc_sw_xstats_init(struct sfc_adapter *sa)
 void
 sfc_sw_xstats_close(struct sfc_adapter *sa)
 {
+       sfc_sw_xstats_free_queues_bitmap(sa);
        rte_free(sa->sw_stats.reset_vals);
        sa->sw_stats.reset_vals = NULL;
-
-       sfc_sw_xstats_free_queues_bitmap(sa);
 }