From: Hemant Agrawal Date: Thu, 3 Sep 2020 17:17:44 +0000 (+0530) Subject: crypto/dpaa2_sec: fix stats query without queue pair X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=356bcac8f11ef916f47be74b295c36755d8165cf;p=dpdk.git crypto/dpaa2_sec: fix stats query without queue pair dpdk-procinfo calls the crypto stats API, which results segmentation fault on DPAA2_SEC. The queue pair array will be NULL, when it is used without configuring the SEC device. Fixes: 02f35eee264b ("crypto/dpaa2_sec: support statistics") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Acked-by: Akhil Goyal --- diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 109e61ae16..f480aafd01 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3501,7 +3501,7 @@ void dpaa2_sec_stats_get(struct rte_cryptodev *dev, return; } for (i = 0; i < dev->data->nb_queue_pairs; i++) { - if (qp[i] == NULL) { + if (qp == NULL || qp[i] == NULL) { DPAA2_SEC_DEBUG("Uninitialised queue pair"); continue; }