DPDK patches and discussions
 help / color / mirror / Atom feed
From: Przemyslaw Zegan <przemyslawx.zegan@intel.com>
To: dev@dpdk.org
Cc: gakhil@marvell.com, roy.fan.zhang@intel.com,
	Przemyslaw Zegan <przemyslawx.zegan@intel.com>
Subject: [dpdk-dev] [PATCH] crypto/qat: fix access to null pointer
Date: Wed,  3 Nov 2021 15:08:43 +0000	[thread overview]
Message-ID: <20211103150843.3235347-1-przemyslawx.zegan@intel.com> (raw)

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 <przemyslawx.zegan@intel.com>
---
 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


             reply	other threads:[~2021-11-03 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 15:08 Przemyslaw Zegan [this message]
2021-11-03 18:03 ` Kusztal, ArkadiuszX
2021-11-04 11:47 ` [dpdk-dev] [EXT] " Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211103150843.3235347-1-przemyslawx.zegan@intel.com \
    --to=przemyslawx.zegan@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).