]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
mwifiex: fix 'smatch' warning in preparing key_material cmd
authorBing Zhao <bzhao@marvell.com>
Thu, 9 Aug 2012 02:01:52 +0000 (19:01 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 10 Aug 2012 19:27:03 +0000 (15:27 -0400)
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>
drivers/net/wireless/mwifiex/sta_cmd.c

index 9af96926093e95c0a6d99cdc4d08f90ec7f9fdd1..0cc3406050dc5d11ac20e26482d609dc54ffeb89 100644 (file)
@@ -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 =