ath10k: off by one sanity check
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 18 Jun 2013 07:28:46 +0000 (10:28 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 18 Jun 2013 18:46:47 +0000 (14:46 -0400)
This should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath10k/pci.c

index 8e4e8327d33e086eedbee49da289c8920b2fe633..c8e9056697015c8f95aea5a4d1512626fd8f45ab 100644 (file)
@@ -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;
        }