Each lut entry is a u16, so fix the valid_len check using sizeof(u16)

Signed-off-by: Christopher Pau <christopher....@intel.com>
Reviewed-by: Shanmugam Jayaprakash <jayaprakash.shanmu...@intel.com>
Reviewed-by: Burra Phani R <phani.r.bu...@intel.com>
Reviewed-by: Kirsher Jeffrey T <jeffrey.t.kirs...@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong...@intel.com>
---
 drivers/net/i40e/base/virtchnl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/i40e/base/virtchnl.h b/drivers/net/i40e/base/virtchnl.h
index 13cd0e5ab..bc9043dde 100644
--- a/drivers/net/i40e/base/virtchnl.h
+++ b/drivers/net/i40e/base/virtchnl.h
@@ -1583,7 +1583,7 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info 
*ver, u32 v_opcode,
                                break;
                        }
 
-                       valid_len += vrl->lut_entries - 1;
+                       valid_len += (vrl->lut_entries - 1) * sizeof(u16);
                }
                break;
        case VIRTCHNL_OP_GET_RSS_HASH:
-- 
2.17.1

Reply via email to