net/bnxt: fix interrupt handler

In some cases the interrupt handler is accessing cpr, which has
already been freed causing segfaults. This patch avoids such accesses.

Fixes: 7bc8e9a227 ("net/bnxt: support async link notification")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
Ajit Khaparde 2017-09-28 16:43:42 -05:00 committed by Ferruh Yigit
parent 86ff87b0ed
commit f7ecea911e
2 changed files with 5 additions and 0 deletions

View File

@ -183,8 +183,10 @@ void bnxt_free_def_cp_ring(struct bnxt *bp)
return;
bnxt_free_ring(cpr->cp_ring_struct);
cpr->cp_ring_struct = NULL;
rte_free(cpr->cp_ring_struct);
rte_free(cpr);
bp->def_cp_ring = NULL;
}
/* For the default completion ring only */

View File

@ -55,6 +55,9 @@ static void bnxt_int_handler(void *param)
struct cmpl_base *cmp;
while (1) {
if (!cpr || !cpr->cp_ring_struct)
return;
cons = RING_CMP(cpr->cp_ring_struct, raw_cons);
cmp = &cpr->cp_desc_ring[cons];