Commit 641c869d authored by Bing Zhao's avatar Bing Zhao Committed by John W. Linville

mwifiex: fix 'smatch' warning in preparing key_material cmd

The key length can be 32 bytes for TKIP and 16 bytes for AES_CMAC.
'smatch' warns on memcpy using key_len variable to copy data to
a 16 bytes buffer. Use fixed length to avoid the warning.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 902d9e0f
...@@ -690,7 +690,7 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, ...@@ -690,7 +690,7 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
memcpy(param->ipn, enc_key->pn, IGTK_PN_LEN); memcpy(param->ipn, enc_key->pn, IGTK_PN_LEN);
memcpy(param->key, enc_key->key_material, memcpy(param->key, enc_key->key_material,
enc_key->key_len); WLAN_KEY_LEN_AES_CMAC);
key_param_len = sizeof(struct mwifiex_cmac_param); key_param_len = sizeof(struct mwifiex_cmac_param);
key_material->key_param_set.key_len = key_material->key_param_set.key_len =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment