cryptodev: fix session pointer cast
authorZhiyong Yang <zhiyong.yang@intel.com>
Tue, 23 Jan 2018 09:48:13 +0000 (17:48 +0800)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 29 Jan 2018 19:22:33 +0000 (20:22 +0100)
The wrong casts don't cause actual error, but they should conform to C
standard.

Fixes: c261d1431bd8 ("security: introduce security API and framework")
Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions")
Cc: stable@dpdk.org
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
lib/librte_cryptodev/rte_cryptodev.c
lib/librte_security/rte_security.c

index 7726d15..8745b6b 100644 (file)
@@ -1094,7 +1094,7 @@ rte_cryptodev_sym_session_create(struct rte_mempool *mp)
        struct rte_cryptodev_sym_session *sess;
 
        /* Allocate a session structure from the session pool */
-       if (rte_mempool_get(mp, (void *)&sess)) {
+       if (rte_mempool_get(mp, (void **)&sess)) {
                CDEV_LOG_ERR("couldn't get object from session mempool");
                return NULL;
        }
index 3888fd4..1e559c9 100644 (file)
@@ -49,7 +49,7 @@ __rte_experimental rte_security_session_create(struct rte_security_ctx *instance
 
        RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->session_create, NULL);
 
-       if (rte_mempool_get(mp, (void *)&sess))
+       if (rte_mempool_get(mp, (void **)&sess))
                return NULL;
 
        if (instance->ops->session_create(instance->device, conf, sess, mp)) {