From: Deepthi Kavalur <[email protected]>

Loop counters in i40e_parse_cee_app_tlv() and
i40e_add_ieee_app_pri_tlv() are declared as u8 but compared against
numapps which is u32. If numapps exceeds 255 the counter wraps,
truncating the iteration. Widen the counters to u32.

Fixes: 166dceeeeafc ("i40e/base: add parsing for CEE DCBX TLVs")
Fixes: 0d9d27bb8684 ("i40e/base: prepare local LLDP MIB in TLV")
Cc: [email protected]

Signed-off-by: Deepthi Kavalur <[email protected]>
Signed-off-by: Ciara Loftus <[email protected]>
---
 .mailmap                               | 1 +
 drivers/net/intel/i40e/base/i40e_dcb.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.mailmap b/.mailmap
index f3130df686..6121833c25 100644
--- a/.mailmap
+++ b/.mailmap
@@ -371,6 +371,7 @@ Dean Marx <[email protected]>
 Declan Doherty <[email protected]>
 Deepak Khandelwal <[email protected]>
 Deepak Kumar Jain <[email protected]>
+Deepthi Kavalur <[email protected]>
 Deirdre O'Connor <[email protected]>
 Dekel Peled <[email protected]> <[email protected]>
 Dengdui Huang <[email protected]>
diff --git a/drivers/net/intel/i40e/base/i40e_dcb.c 
b/drivers/net/intel/i40e/base/i40e_dcb.c
index 04322ea034..c1d97fabab 100644
--- a/drivers/net/intel/i40e/base/i40e_dcb.c
+++ b/drivers/net/intel/i40e/base/i40e_dcb.c
@@ -364,7 +364,7 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv 
*tlv,
 {
        u16 length, typelength, offset = 0;
        struct i40e_cee_app_prio *app;
-       u8 i;
+       u32 i;
 
        typelength = I40E_NTOHS(tlv->hdr.typelen);
        length = (u16)((typelength & I40E_LLDP_TLV_LEN_MASK) >>
@@ -1169,9 +1169,9 @@ static void i40e_add_ieee_app_pri_tlv(struct 
i40e_lldp_org_tlv *tlv,
                                      struct i40e_dcbx_config *dcbcfg)
 {
        u16 typelength, length, offset = 0;
-       u8 priority, selector, i = 0;
        u8 *buf = tlv->tlvinfo;
-       u32 ouisubtype;
+       u32 ouisubtype, i = 0;
+       u8 priority, selector;
 
        /* No APP TLVs then just return */
        if (dcbcfg->numapps == 0)
-- 
2.43.0

Reply via email to