提交 3ed439c5 编写于 作者: C Catherine Sullivan 提交者: Jeff Kirsher

i40e: Fix uninitialized variable

We have an uninitialized variable warning for valid_len for one case in
validate_vf_mesg. To fix this, just initialize it to 0 at the top of the
function and remove all of the now redundant assignments to 0 in the
individual cases.

Change-Id: Iacbd97f4c521ed8d662eef803a598d8707708cfd
Signed-off-by: NCatherine Sullivan <catherine.sullivan@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 b29699b3
...@@ -2356,7 +2356,7 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode, ...@@ -2356,7 +2356,7 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode,
u32 v_retval, u8 *msg, u16 msglen) u32 v_retval, u8 *msg, u16 msglen)
{ {
bool err_msg_format = false; bool err_msg_format = false;
int valid_len; int valid_len = 0;
/* Check if VF is disabled. */ /* Check if VF is disabled. */
if (test_bit(I40E_VF_STAT_DISABLED, &vf->vf_states)) if (test_bit(I40E_VF_STAT_DISABLED, &vf->vf_states))
...@@ -2368,13 +2368,10 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode, ...@@ -2368,13 +2368,10 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode,
valid_len = sizeof(struct i40e_virtchnl_version_info); valid_len = sizeof(struct i40e_virtchnl_version_info);
break; break;
case I40E_VIRTCHNL_OP_RESET_VF: case I40E_VIRTCHNL_OP_RESET_VF:
valid_len = 0;
break; break;
case I40E_VIRTCHNL_OP_GET_VF_RESOURCES: case I40E_VIRTCHNL_OP_GET_VF_RESOURCES:
if (VF_IS_V11(vf)) if (VF_IS_V11(vf))
valid_len = sizeof(u32); valid_len = sizeof(u32);
else
valid_len = 0;
break; break;
case I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE: case I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE:
valid_len = sizeof(struct i40e_virtchnl_txq_info); valid_len = sizeof(struct i40e_virtchnl_txq_info);
...@@ -2489,7 +2486,6 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode, ...@@ -2489,7 +2486,6 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode,
} }
break; break;
case I40E_VIRTCHNL_OP_GET_RSS_HENA_CAPS: case I40E_VIRTCHNL_OP_GET_RSS_HENA_CAPS:
valid_len = 0;
break; break;
case I40E_VIRTCHNL_OP_SET_RSS_HENA: case I40E_VIRTCHNL_OP_SET_RSS_HENA:
valid_len = sizeof(struct i40e_virtchnl_rss_hena); valid_len = sizeof(struct i40e_virtchnl_rss_hena);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册