Skip to content

Commit d1392a6

Browse files
prashantgupta-psShani Peretz
authored andcommitted
net/dpaa2: fix uninitialized variable
[ upstream commit 058043d ] Initialize the kg_cfg structure before use in rte_pmd_dpaa2_set_custom_hash(). This resolves an issue with uninitialized memory access. Fixes: 5f82296 ("net/dpaa2: support custom hash key") Signed-off-by: Prashant Gupta <prashant.gupta_3@nxp.com>
1 parent 12acafb commit d1392a6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,7 @@ Piotr Pietruszewski <piotr.pietruszewski@intel.com>
11611161
Piotr Skajewski <piotrx.skajewski@intel.com>
11621162
Pradeep Satyanarayana <pradeep@us.ibm.com>
11631163
Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
1164+
Prashant Gupta <prashant.gupta_3@nxp.com>
11641165
Prashant Upadhyaya <prashant.upadhyaya@aricent.com> <praupadhyaya@gmail.com>
11651166
Prateek Agarwal <prateekag@cse.iitb.ac.in>
11661167
Praveen Kaligineedi <pkaligineedi@google.com>

drivers/net/dpaa2/base/dpaa2_hw_dpni.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* SPDX-License-Identifier: BSD-3-Clause
22
*
33
* Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
4-
* Copyright 2016-2021 NXP
4+
* Copyright 2016-2021,2023-2025 NXP
55
*
66
*/
77

@@ -59,6 +59,7 @@ rte_pmd_dpaa2_set_custom_hash(uint16_t port_id,
5959
return -ENOMEM;
6060
}
6161

62+
memset(&kg_cfg, 0, sizeof(struct dpkg_profile_cfg));
6263
kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_DATA;
6364
kg_cfg.extracts[0].extract.from_data.offset = offset;
6465
kg_cfg.extracts[0].extract.from_data.size = size;

0 commit comments

Comments
 (0)