Commit 62e3ffa4ea4ede96b21b2fac6b29e904765c8b3f

Authored by Vasundhara Volam
Committed by Greg Kroah-Hartman
1 parent 0234e8ebb7

bnxt_en: Reset rings if ring reservation fails during open()

[ Upstream commit 5d765a5e4bd7c368e564e11402bba74cf7f03ac1 ]

If ring counts are not reset when ring reservation fails,
bnxt_init_dflt_ring_mode() will not be called again to reinitialise
IRQs when open() is called and results in system crash as napi will
also be not initialised. This patch fixes it by resetting the ring
counts.

Fixes: 47558acd56a7 ("bnxt_en: Reserve rings at driver open if none was reserved at probe time.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff

drivers/net/ethernet/broadcom/bnxt/bnxt.c
... ... @@ -11603,6 +11603,10 @@
11603 11603 bp->rx_nr_rings++;
11604 11604 bp->cp_nr_rings++;
11605 11605 }
  11606 + if (rc) {
  11607 + bp->tx_nr_rings = 0;
  11608 + bp->rx_nr_rings = 0;
  11609 + }
11606 11610 return rc;
11607 11611 }
11608 11612