crypto/scheduler: fix slave name parsing
authorFan Zhang <roy.fan.zhang@intel.com>
Fri, 7 Jul 2017 05:17:30 +0000 (06:17 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 19 Jul 2017 11:10:40 +0000 (14:10 +0300)
This patch fixes the incorrect index checking in parse_slave
function.

Fixes: 503e9c5afb38 ("crypto/scheduler: register as vdev driver")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
drivers/crypto/scheduler/scheduler_pmd.c

index 0f57fbe..400fc4f 100644 (file)
@@ -325,7 +325,7 @@ parse_slave_arg(const char *key __rte_unused,
 {
        struct scheduler_init_params *param = extra_args;
 
-       if (param->nb_slaves >= RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES - 1) {
+       if (param->nb_slaves >= RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES) {
                CS_LOG_ERR("Too many slaves.\n");
                return -ENOMEM;
        }