Commit 736e3aca authored by Gertjan van Wingerde's avatar Gertjan van Wingerde Committed by John W. Linville

rt2x00: Fix pointer errors.

Fix some pointer errors in the various calls to memcpy, memset and memmove.

Although none of these errors are fatal (the expression used now results in
the same pointer value) it is better to use the proper expression.
All errors are having to deal with arrays.
Signed-off-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a39fd6be
...@@ -62,13 +62,13 @@ void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev, ...@@ -62,13 +62,13 @@ void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
* This will prevent the device being confused when it wants * This will prevent the device being confused when it wants
* to ACK frames or consideres itself associated. * to ACK frames or consideres itself associated.
*/ */
memset(&conf.mac, 0, sizeof(conf.mac)); memset(conf.mac, 0, sizeof(conf.mac));
if (mac) if (mac)
memcpy(&conf.mac, mac, ETH_ALEN); memcpy(conf.mac, mac, ETH_ALEN);
memset(&conf.bssid, 0, sizeof(conf.bssid)); memset(conf.bssid, 0, sizeof(conf.bssid));
if (bssid) if (bssid)
memcpy(&conf.bssid, bssid, ETH_ALEN); memcpy(conf.bssid, bssid, ETH_ALEN);
flags |= CONFIG_UPDATE_TYPE; flags |= CONFIG_UPDATE_TYPE;
if (mac || (!rt2x00dev->intf_ap_count && !rt2x00dev->intf_sta_count)) if (mac || (!rt2x00dev->intf_ap_count && !rt2x00dev->intf_sta_count))
......
...@@ -471,17 +471,17 @@ EXPORT_SYMBOL_GPL(rt2x00mac_set_tim); ...@@ -471,17 +471,17 @@ EXPORT_SYMBOL_GPL(rt2x00mac_set_tim);
static void memcpy_tkip(struct rt2x00lib_crypto *crypto, u8 *key, u8 key_len) static void memcpy_tkip(struct rt2x00lib_crypto *crypto, u8 *key, u8 key_len)
{ {
if (key_len > NL80211_TKIP_DATA_OFFSET_ENCR_KEY) if (key_len > NL80211_TKIP_DATA_OFFSET_ENCR_KEY)
memcpy(&crypto->key, memcpy(crypto->key,
&key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY], &key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY],
sizeof(crypto->key)); sizeof(crypto->key));
if (key_len > NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY) if (key_len > NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY)
memcpy(&crypto->tx_mic, memcpy(crypto->tx_mic,
&key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY], &key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY],
sizeof(crypto->tx_mic)); sizeof(crypto->tx_mic));
if (key_len > NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY) if (key_len > NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY)
memcpy(&crypto->rx_mic, memcpy(crypto->rx_mic,
&key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY], &key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY],
sizeof(crypto->rx_mic)); sizeof(crypto->rx_mic));
} }
...@@ -532,7 +532,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -532,7 +532,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
if (crypto.cipher == CIPHER_TKIP) if (crypto.cipher == CIPHER_TKIP)
memcpy_tkip(&crypto, &key->key[0], key->keylen); memcpy_tkip(&crypto, &key->key[0], key->keylen);
else else
memcpy(&crypto.key, &key->key[0], key->keylen); memcpy(crypto.key, &key->key[0], key->keylen);
/* /*
* Each BSS has a maximum of 4 shared keys. * Each BSS has a maximum of 4 shared keys.
* Shared key index values: * Shared key index values:
......
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