From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 26DF3A0C53; Wed, 3 Nov 2021 16:10:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1488241C26; Wed, 3 Nov 2021 16:10:42 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 6104F41134 for ; Wed, 3 Nov 2021 16:10:39 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10156"; a="228963885" X-IronPort-AV: E=Sophos;i="5.87,206,1631602800"; d="scan'208";a="228963885" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 08:08:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,206,1631602800"; d="scan'208";a="449844380" Received: from silpixa00401012.ir.intel.com ([10.243.22.70]) by orsmga006.jf.intel.com with ESMTP; 03 Nov 2021 08:08:47 -0700 From: Przemyslaw Zegan To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Przemyslaw Zegan Date: Wed, 3 Nov 2021 15:08:43 +0000 Message-Id: <20211103150843.3235347-1-przemyslawx.zegan@intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] crypto/qat: fix access to null pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" This patch fixes a possible access to null pointer Fixes: 9f4b9222019c ("common/qat: add gen specific queue implementation") Cc: roy.fan.zhang@intel.com Signed-off-by: Przemyslaw Zegan --- drivers/common/qat/dev/qat_dev_gen1.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/common/qat/dev/qat_dev_gen1.c b/drivers/common/qat/dev/qat_dev_gen1.c index ed4c4a2c03..f15238cc23 100644 --- a/drivers/common/qat/dev/qat_dev_gen1.c +++ b/drivers/common/qat/dev/qat_dev_gen1.c @@ -92,6 +92,9 @@ qat_qp_rings_per_service_gen1(struct qat_pci_device *qat_dev, for (i = 0; i < ADF_MAX_QPS_ON_ANY_SERVICE; i++) { const struct qat_qp_hw_data *hw_qps = qat_qp_get_hw_data(qat_dev, service, i); + + if(hw_qps == NULL) + continue; if (hw_qps->service_type == service) count++; } -- 2.30.2