[dpdk-dev] lib: fix wrong cast

Message ID 20180123094813.65813-1-zhiyong.yang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Yang, Zhiyong Jan. 23, 2018, 9:48 a.m. UTC
  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
Cc: declan.doherty@intel.com
Cc: akhil.goyal@nxp.com

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 lib/librte_cryptodev/rte_cryptodev.c | 2 +-
 lib/librte_security/rte_security.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Akhil Goyal Jan. 23, 2018, 9:59 a.m. UTC | #1
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  
De Lara Guarch, Pablo Jan. 23, 2018, 3:31 p.m. UTC | #2
> -----Original Message-----
> From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Zhiyong Yang
> Sent: Tuesday, January 23, 2018 9:48 AM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; thomas@monjalon.net;
> stable@dpdk.org; Doherty, Declan <declan.doherty@intel.com>;
> akhil.goyal@nxp.com; Yang, Zhiyong <zhiyong.yang@intel.com>
> Subject: [dpdk-stable] [PATCH] lib: fix wrong cast
> 
> 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
> Cc: declan.doherty@intel.com
> Cc: akhil.goyal@nxp.com
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
De Lara Guarch, Pablo Jan. 23, 2018, 3:39 p.m. UTC | #3
> -----Original Message-----
> From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of De Lara
> Guarch, Pablo
> Sent: Tuesday, January 23, 2018 3:31 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; thomas@monjalon.net;
> stable@dpdk.org; Doherty, Declan <declan.doherty@intel.com>;
> akhil.goyal@nxp.com; Yang, Zhiyong <zhiyong.yang@intel.com>
> Subject: Re: [dpdk-stable] [PATCH] lib: fix wrong cast
> 
> 
> 
> > -----Original Message-----
> > From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Zhiyong
> > Yang
> > Sent: Tuesday, January 23, 2018 9:48 AM
> > To: dev@dpdk.org
> > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; thomas@monjalon.net;
> > stable@dpdk.org; Doherty, Declan <declan.doherty@intel.com>;
> > akhil.goyal@nxp.com; Yang, Zhiyong <zhiyong.yang@intel.com>
> > Subject: [dpdk-stable] [PATCH] lib: fix wrong cast
> >
> > 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
> > Cc: declan.doherty@intel.com
> > Cc: akhil.goyal@nxp.com
> >
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo
  

Patch

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 7726d15f4..8745b6b02 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -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;
 	}
diff --git a/lib/librte_security/rte_security.c b/lib/librte_security/rte_security.c
index 6461dba05..d98f46dea 100644
--- a/lib/librte_security/rte_security.c
+++ b/lib/librte_security/rte_security.c
@@ -49,7 +49,7 @@  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)) {