From patchwork Thu Sep 3 17:17:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 249034 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6447:0:0:0:0 with SMTP id l7csp629846ejn; Thu, 3 Sep 2020 10:24:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTSajdQmSmN70gi+sRAdS6gL1rpTcuf+8SAb7V3amgP4iTAGxigTdoMAi8RUn9X3CJDOG9 X-Received: by 2002:a17:906:370a:: with SMTP id d10mr3372905ejc.393.1599153841243; Thu, 03 Sep 2020 10:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599153841; cv=none; d=google.com; s=arc-20160816; b=JOFa+KRnGBbVY6XuXG5bt9gTi6bN7aP4xDAyQeAI/LLL6yEbiudTxI3BTNGfNXL81Z 1CHtWM2e3jb16xhlwZ1f+NI/HMi9fs43d5Ss3OOVnCIY06M3M76RG7YUzEBS274f4Zc4 TYiGMjBJOxDadG8cRA8o6Jj3dgmjvovI/4MhcOiSMcRoBuSpfQiWxoxWchkAUkE5ognl gdUgsn1I2de1i0AI6ph2KYQy8pm6hv1VHH1G6Oy2k0eywWBbImv2Nm8D0rqJO+Ukn2A+ /glUuT5waNrsoRnPke0+8QG58vFMMwp/uZkEEYbOXab9XG+PWwQGCHW/j6Zp2fufrRyY +qnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=JMtnN8SE4yl2Obg0AMxcZ8IYpQwws+FNHTl2LbTelOc=; b=OqUuy8OuFwOLQVAELFQboaKi+nnIMLnhye/ZUJ3AcxckUy9jzAlUFpAmoyNa5+HXKt NHh9NJ/1DIymMRt7oIyDNbxe8IKQgDG/VoVZ+8vWVlBqWdhKVpvXse6zK9xF7BV6RbIM r6OPo/S1wKv+usV0fqwhpM1yA5RgeACLx+XwZmD7PRlmsFvoHnM9bmIDBgO34gO53PDM HmAuBJ4zuFQW8Zi17dqcNGZcFxjffTK94mWviI2rGXZcw+lU5mBjjk3qSMJtA4hmxbPA 0fcCmvP7urGrO27Ar+Qz6qOwtY8v/gVQvS9VPeTwz0Oo5i2zdik1fLJut72RzScFHTOi UgFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id df8si2012803edb.237.2020.09.03.10.24.00; Thu, 03 Sep 2020 10:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 394C61C0B5; Thu, 3 Sep 2020 19:24:00 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 29386E07; Thu, 3 Sep 2020 19:23:59 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E0C5D200215; Thu, 3 Sep 2020 19:23:58 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D347E2002AD; Thu, 3 Sep 2020 19:23:56 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D97E7402DD; Thu, 3 Sep 2020 19:23:53 +0200 (CEST) From: Hemant Agrawal To: dev@dpdk.org Cc: akhil.goyal@nxp.com, stable@dpdk.org, Hemant Agrawal Date: Thu, 3 Sep 2020 22:47:44 +0530 Message-Id: <20200903171745.13985-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/2] crypto/dpaa2_sec: fix to check queue pair array for null X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 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 109e61ae1..f480aafd0 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; }