common/qat: fix undefined initial slice

Message ID 20221107092336.45559-1-arkadiuszx.kusztal@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series common/qat: fix undefined initial slice |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Arkadiusz Kusztal Nov. 7, 2022, 9:23 a.m. UTC
  This commit fixes undefined initial value of slice capability.
When unset it could lead to undefined read of capability due to
stack frame picked values, is should therefore be set to 0.

Fixes: b3cbbcdffa4f ("common/qat: read HW slice configuration")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/common/qat/qat_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ji, Kai Nov. 7, 2022, 10:35 a.m. UTC | #1
Acked-by: Kai Ji <kai.ji@intel.com>

> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Monday, November 7, 2022 9:24 AM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Ji, Kai <kai.ji@intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH] common/qat: fix undefined initial slice
> 
> This commit fixes undefined initial value of slice capability.
> When unset it could lead to undefined read of capability due to stack frame
> picked values, is should therefore be set to 0.
> 
> Fixes: b3cbbcdffa4f ("common/qat: read HW slice configuration")
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
> 2.13.6
  
Akhil Goyal Nov. 8, 2022, 5:17 a.m. UTC | #2
> Acked-by: Kai Ji <kai.ji@intel.com>
> 

You should reply in the bottom.
> > Subject: [PATCH] common/qat: fix undefined initial slice
> >
> > This commit fixes undefined initial value of slice capability.
> > When unset it could lead to undefined read of capability due to stack frame
> > picked values, is should therefore be set to 0.
> >
> > Fixes: b3cbbcdffa4f ("common/qat: read HW slice configuration")
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index 057ba60931..8bce2ac073 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -361,7 +361,7 @@  static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 {
 	int sym_ret = 0, asym_ret = 0, comp_ret = 0;
 	int num_pmds_created = 0;
-	uint16_t capa;
+	uint16_t capa = 0;
 	struct qat_pci_device *qat_pci_dev;
 	struct qat_dev_hw_spec_funcs *ops_hw;
 	struct qat_dev_cmd_param qat_dev_cmd_param[] = {