crypto/scheduler: fix session free
authorFan Zhang <roy.fan.zhang@intel.com>
Tue, 4 Apr 2017 09:31:08 +0000 (10:31 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 5 Apr 2017 22:17:44 +0000 (00:17 +0200)
This patch fixes the incorrection slave session free operation.

Fixes: 57523e682bb7 ("crypto/scheduler: register operation functions")

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_ops.c

index f02506c..34e0cc9 100644 (file)
@@ -426,16 +426,13 @@ config_slave_sess(struct scheduler_ctx *sched_ctx,
 
        for (i = 0; i < sched_ctx->nb_slaves; i++) {
                struct scheduler_slave *slave = &sched_ctx->slaves[i];
-               struct rte_cryptodev *dev =
-                               rte_cryptodev_pmd_get_dev(slave->dev_id);
 
                if (sess->sessions[i]) {
                        if (create)
                                continue;
                        /* !create */
-                       (*dev->dev_ops->session_clear)(dev,
-                                       (void *)sess->sessions[i]);
-                       sess->sessions[i] = NULL;
+                       sess->sessions[i] = rte_cryptodev_sym_session_free(
+                                       slave->dev_id, sess->sessions[i]);
                } else {
                        if (!create)
                                continue;