Skip to contentSkip to conversation

ath10k: off by one sanity check

PATCH New Dan Carpenter 2 participants 2 messages Jun 18, 2013 – Jul 5, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: off by one sanity check

This should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().

drivers/net/wireless/ath/ath10k/pci.c +1 -1
index 8e4e832..c8e9056 100644
@@ -1772,7 +1772,7 @@ static irqreturn_t ath10k_pci_per_engine_handler(int irq, void *arg)
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	int ce_id = irq - ar_pci->pdev->irq - MSI_ASSIGN_CE_INITIAL;
 
-	if (ce_id < 0 || ce_id > ARRAY_SIZE(ar_pci->pipe_info)) {
+	if (ce_id < 0 || ce_id >= ARRAY_SIZE(ar_pci->pipe_info)) {
 		ath10k_warn("unexpected/invalid irq %d ce_id %d\n", irq, ce_id);
 		return IRQ_HANDLED;
 	}
#1 lore raw

PATCH 1/1 ath10k: off by one sanity check

Quoted 3 lines · Dan Carpenter

This should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().

Thanks for the patch. John already applied this to his wireless-next tree.

Signature · 1 line
Kalle Valo