Skip to content

Commit 30f24ea

Browse files
jmberg-intellucacoelho
authored andcommitted
iwlwifi: pcie: don't crash on invalid RX interrupt
If for some reason the device gives us an RX interrupt before we're ready for it, perhaps during device power-on with misconfigured IRQ causes mapping or so, we can crash trying to access the queues. Prevent that by checking that we actually have RXQs and that they were properly allocated. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
1 parent c5bf4fa commit 30f24ea

File tree

1 file changed

+6
-1
lines changed
  • drivers/net/wireless/intel/iwlwifi/pcie

1 file changed

+6
-1
lines changed

drivers/net/wireless/intel/iwlwifi/pcie/rx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,10 +1429,15 @@ static struct iwl_rx_mem_buffer *iwl_pcie_get_rxb(struct iwl_trans *trans,
14291429
static void iwl_pcie_rx_handle(struct iwl_trans *trans, int queue)
14301430
{
14311431
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
1432-
struct iwl_rxq *rxq = &trans_pcie->rxq[queue];
1432+
struct iwl_rxq *rxq;
14331433
u32 r, i, count = 0;
14341434
bool emergency = false;
14351435

1436+
if (WARN_ON_ONCE(!trans_pcie->rxq || !trans_pcie->rxq[queue].bd))
1437+
return;
1438+
1439+
rxq = &trans_pcie->rxq[queue];
1440+
14361441
restart:
14371442
spin_lock(&rxq->lock);
14381443
/* uCode's read index (stored in shared DRAM) indicates the last Rx

0 commit comments

Comments
 (0)