crypto/qat: fix access to null pointer
Checks
Commit Message
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(+)
Comments
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Przemyslaw Zegan
> Sent: Wednesday, November 3, 2021 4:09 PM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Zegan,
> PrzemyslawX <przemyslawx.zegan@intel.com>
> Subject: [dpdk-dev] [PATCH] crypto/qat: fix access to null pointer
>
> 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>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> 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>
Patch squashed to original patch as it was not merged.
Fixed check patch error.
@@ -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++;
}