summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFan Zhang <roy.fan.zhang@intel.com>2021-05-07 12:50:18 +0100
committerDamjan Marion <dmarion@me.com>2021-05-07 16:31:42 +0000
commit7508f0a7ea325b5c65f516acaa4ccd074a122af3 (patch)
tree00319a3f74e8202a5473882e582322c7e9a8de1e /src/plugins
parentc62252df1522318d65ca584a53cdfef29b3f839c (diff)
dpdk: fix cryptodev session handler
Type: fix This patch fixes the possible segmentation fault in DPDK cryptodev when deleting session. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Change-Id: Ie81de09f7250eb5c1ed6ee471363137d8372fe27
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dpdk/cryptodev/cryptodev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/dpdk/cryptodev/cryptodev.c b/src/plugins/dpdk/cryptodev/cryptodev.c
index a310538f064..246951d396c 100644
--- a/src/plugins/dpdk/cryptodev/cryptodev.c
+++ b/src/plugins/dpdk/cryptodev/cryptodev.c
@@ -287,6 +287,10 @@ cryptodev_sess_handler (vlib_main_t *vm, vnet_crypto_key_op_t kop,
vec_foreach_index (i, cmt->per_numa_data)
{
+ if (!ckey->keys)
+ continue;
+ if (!ckey->keys[i])
+ continue;
if (ckey->keys[i][CRYPTODEV_OP_TYPE_ENCRYPT])
{
cryptodev_session_del (ckey->keys[i][CRYPTODEV_OP_TYPE_ENCRYPT]);