The field offset argument type inside ice driver is of "int" type, but
when parsing and storing the value from a devarg, a uint8_t type is
used, leading to 3 bytes being potentially uninitialized. Fix this by
storing to an int type instead.

Bugzilla ID: 2038
Fixes: df539aaf35cb ("net/ice: refactor flex descriptor protocol field 
extraction")
Cc: [email protected]

Signed-off-by: Bruce Richardson <[email protected]>
---
Note: this fix is superceded by the kvargs numeric args patchset [1].
However, that patchset relies on new kvargs features unlikely to be
backported, so this standalone fix is useful for backporting or if the
whole other set doesn't make the 26.11 release.

[1] https://patches.dpdk.org/project/dpdk/list/?series=39247
---
 drivers/net/intel/ice/ice_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/intel/ice/ice_ethdev.c 
b/drivers/net/intel/ice/ice_ethdev.c
index 3938186228..2f97140bef 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -735,7 +735,7 @@ static int
 handle_field_offs_arg(__rte_unused const char *key, const char *value,
                                void *offs_args)
 {
-       uint8_t *offset = offs_args;
+       int *offset = offs_args;
 
        if (value == NULL || offs_args == NULL)
                return -EINVAL;
-- 
2.53.0

Reply via email to