[1/2] event/dlb2: fix port_cos array sizing

Message ID 20220629153638.1269743-2-timothy.mcdaniel@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series DLB2 Bug Fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Timothy McDaniel June 29, 2022, 3:36 p.m. UTC
  This commit fixes a segfault that resulted from reading
beyond the end of the port_cos array. The root cause was using
the DLB num ports define instead of the eventdev num ports define.

Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS")
Cc: timothy.mcdaniel@intel.com

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb2/dlb2_priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_priv.h
index 528e2ede61..8744efa79d 100644
--- a/drivers/event/dlb2/dlb2_priv.h
+++ b/drivers/event/dlb2/dlb2_priv.h
@@ -640,7 +640,7 @@  struct dlb2_cq_weight {
 };
 
 struct dlb2_port_cos {
-	int cos_id[DLB2_MAX_NUM_LDB_PORTS];
+	int cos_id[DLB2_MAX_NUM_PORTS_ALL];
 };
 
 struct dlb2_cos_bw {