crypto/dpaa_sec: fix null check in uninit
authorShreyansh Jain <shreyansh.jain@nxp.com>
Mon, 2 Apr 2018 15:33:19 +0000 (21:03 +0530)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 23 Apr 2018 17:20:09 +0000 (18:20 +0100)
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

index 21abd82..a260a11 100644 (file)
@@ -2234,11 +2234,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);