Skip to content

Commit

Permalink
mwifiex: fix 'smatch' warning in preparing key_material cmd
Browse files Browse the repository at this point in the history
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Bing Zhao authored and John W. Linville committed Aug 10, 2012
1 parent 902d9e0 commit 641c869
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/mwifiex/sta_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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->key, enc_key->key_material,
enc_key->key_len);
WLAN_KEY_LEN_AES_CMAC);

key_param_len = sizeof(struct mwifiex_cmac_param);
key_material->key_param_set.key_len =
Expand Down

0 comments on commit 641c869

Please sign in to comment.