diff mbox series

[v3,6/8] crypto/dpaa_sec: fix incorrect NULL check

Message ID 1522683201-23963-7-git-send-email-hemant.agrawal@nxp.com
State New
Headers show
Series sec | expand

Commit Message

Hemant Agrawal April 2, 2018, 3:33 p.m. UTC
From: Shreyansh Jain <shreyansh.jain@nxp.com>


Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: akhil.goyal@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>

---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.7.4
diff mbox series

Patch

diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index eebb905..2df5e5c 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -2252,11 +2252,12 @@  struct rte_security_ops dpaa_sec_security_ops = {
 static int
 dpaa_sec_uninit(struct rte_cryptodev *dev)
 {
-	struct dpaa_sec_dev_private *internals = dev->data->dev_private;
+	struct dpaa_sec_dev_private *internals;
 
 	if (dev == NULL)
 		return -ENODEV;
 
+	internals = dev->data->dev_private;
 	rte_free(dev->security_ctx);
 
 	rte_mempool_free(internals->ctx_pool);