dmaengine: cppi41: Fix channel queues array size check
authorGomonovych, Vasyl <gomonovych@gmail.com>
Thu, 21 Dec 2017 15:53:04 +0000 (16:53 +0100)
committerVinod Koul <vinod.koul@intel.com>
Fri, 22 Dec 2017 12:17:04 +0000 (17:47 +0530)
The test should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/cppi41.c

index f7e965f632747aa4c4a5532cd010d847917bbb67..d9bee65a18a4aa16fed2d2d5bcdf68df6d799601 100644 (file)
@@ -934,7 +934,7 @@ static bool cpp41_dma_filter_fn(struct dma_chan *chan, void *param)
 
        BUILD_BUG_ON(ARRAY_SIZE(am335x_usb_queues_rx) !=
                     ARRAY_SIZE(am335x_usb_queues_tx));
-       if (WARN_ON(cchan->port_num > ARRAY_SIZE(am335x_usb_queues_rx)))
+       if (WARN_ON(cchan->port_num >= ARRAY_SIZE(am335x_usb_queues_rx)))
                return false;
 
        cchan->q_num = queues[cchan->port_num].submit;