From: Gomonovych, Vasyl Date: Thu, 21 Dec 2017 15:53:04 +0000 (+0100) Subject: dmaengine: cppi41: Fix channel queues array size check X-Git-Tag: v4.16-rc1~138^2~14^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a358f50c3cdeffc0ba877423295fd4e81f5b2bb;p=thirdparty%2Fkernel%2Flinux.git dmaengine: cppi41: Fix channel queues array size check The test should be >= ARRAY_SIZE() instead of > ARRAY_SIZE(). Signed-off-by: Vasyl Gomonovych Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index f7e965f632747..d9bee65a18a4a 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -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;