diff mbox series

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

Message ID 1522654594-2757-6-git-send-email-hemant.agrawal@nxp.com
State Superseded
Headers show
Series [v2,1/8] test/crypto: add macro for dpaa sec device name | expand

Commit Message

Hemant Agrawal April 2, 2018, 7:36 a.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);