Initialize the kg_cfg structure before use in
rte_pmd_dpaa2_set_custom_hash(). This resolves an issue with
uninitialized memory access.

Fixes: 5f822962498e ("net/dpaa2: support custom hash key")
Cc: [email protected]

Signed-off-by: Prashant Gupta <[email protected]>
---
 .mailmap                               | 1 +
 drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 0b043cb0c0..c260830f20 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1261,6 +1261,7 @@ Piotr Skajewski <[email protected]>
 Potnuri Bharat Teja <[email protected]>
 Pradeep Satyanarayana <[email protected]>
 Prashant Bhole <[email protected]>
+Prashant Gupta <[email protected]>
 Prashant Upadhyaya <[email protected]> <[email protected]>
 Prateek Agarwal <[email protected]>
 Prathisna Padmasanan <[email protected]>
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c 
b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index b1d473429a..13825046d8 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2021,2023-2024 NXP
+ *   Copyright 2016-2021,2023-2025 NXP
  *
  */
 
@@ -60,6 +60,7 @@ rte_pmd_dpaa2_set_custom_hash(uint16_t port_id,
                return -ENOMEM;
        }
 
+       memset(&kg_cfg, 0, sizeof(struct dpkg_profile_cfg));
        kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_DATA;
        kg_cfg.extracts[0].extract.from_data.offset = offset;
        kg_cfg.extracts[0].extract.from_data.size = size;
-- 
2.43.0

Reply via email to