From: Yunjian Wang Date: Sat, 5 Sep 2020 10:26:02 +0000 (+0800) Subject: crypto/dpaa_sec: fix a null pointer dereference X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8839c8a1f79e722be6397590bd7d255972a398b4;p=dpdk.git crypto/dpaa_sec: fix a null pointer dereference This patch fixes a null pointer dereference after null check detected by coverity scan. Coverity issue: 349904 Fixes: 6a0c9d364afc ("crypto/dpaax_sec: support HFN override") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Acked-by: Akhil Goyal --- diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 97002170b0..0495422a4c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2949,7 +2949,8 @@ dpaa_sec_set_pdcp_session(struct rte_cryptodev *dev, session->pdcp.hfn = pdcp_xform->hfn; session->pdcp.hfn_threshold = pdcp_xform->hfn_threshold; session->pdcp.hfn_ovd = pdcp_xform->hfn_ovrd; - session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; + if (cipher_xform) + session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; rte_spinlock_lock(&dev_priv->lock); for (i = 0; i < MAX_DPAA_CORES; i++) {