net/dpaa: fix array overrun
authorHemant Agrawal <hemant.agrawal@nxp.com>
Mon, 9 Apr 2018 10:22:46 +0000 (15:52 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Apr 2018 22:20:33 +0000 (00:20 +0200)
Coverity issue: 268342
Fixes: 62f53995caaf ("net/dpaa: add frame count based tail drop with CGR")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
drivers/net/dpaa/dpaa_ethdev.c

index db49364..0aad111 100644 (file)
@@ -1105,10 +1105,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
                        dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE;
        }
 
-       /* Each device can not have more than DPAA_PCD_FQID_MULTIPLIER RX
+       /* Each device can not have more than DPAA_MAX_NUM_PCD_QUEUES RX
         * queues.
         */
-       if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_PCD_FQID_MULTIPLIER) {
+       if (num_rx_fqs <= 0 || num_rx_fqs > DPAA_MAX_NUM_PCD_QUEUES) {
                DPAA_PMD_ERR("Invalid number of RX queues\n");
                return -EINVAL;
        }