diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-12-27 09:05:55 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-01-04 14:35:14 -0500 |
commit | 736e3acadce8438e610b897af2b1c472ed58444b (patch) | |
tree | e3aed29f1f243534d19ac9c866725f4441dd4e82 /drivers/net/wireless | |
parent | a39fd6be19bde021314262a6d2193b3792c808db (diff) |
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: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00config.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index 70ca9379833b..e7f67d5eda52 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c | |||
@@ -62,13 +62,13 @@ void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev, | |||
62 | * This will prevent the device being confused when it wants | 62 | * This will prevent the device being confused when it wants |
63 | * to ACK frames or consideres itself associated. | 63 | * to ACK frames or consideres itself associated. |
64 | */ | 64 | */ |
65 | memset(&conf.mac, 0, sizeof(conf.mac)); | 65 | memset(conf.mac, 0, sizeof(conf.mac)); |
66 | if (mac) | 66 | if (mac) |
67 | memcpy(&conf.mac, mac, ETH_ALEN); | 67 | memcpy(conf.mac, mac, ETH_ALEN); |
68 | 68 | ||
69 | memset(&conf.bssid, 0, sizeof(conf.bssid)); | 69 | memset(conf.bssid, 0, sizeof(conf.bssid)); |
70 | if (bssid) | 70 | if (bssid) |
71 | memcpy(&conf.bssid, bssid, ETH_ALEN); | 71 | memcpy(conf.bssid, bssid, ETH_ALEN); |
72 | 72 | ||
73 | flags |= CONFIG_UPDATE_TYPE; | 73 | flags |= CONFIG_UPDATE_TYPE; |
74 | if (mac || (!rt2x00dev->intf_ap_count && !rt2x00dev->intf_sta_count)) | 74 | if (mac || (!rt2x00dev->intf_ap_count && !rt2x00dev->intf_sta_count)) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index f8775c488be4..a2266c7d86c2 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -471,17 +471,17 @@ EXPORT_SYMBOL_GPL(rt2x00mac_set_tim); | |||
471 | static void memcpy_tkip(struct rt2x00lib_crypto *crypto, u8 *key, u8 key_len) | 471 | static void memcpy_tkip(struct rt2x00lib_crypto *crypto, u8 *key, u8 key_len) |
472 | { | 472 | { |
473 | if (key_len > NL80211_TKIP_DATA_OFFSET_ENCR_KEY) | 473 | if (key_len > NL80211_TKIP_DATA_OFFSET_ENCR_KEY) |
474 | memcpy(&crypto->key, | 474 | memcpy(crypto->key, |
475 | &key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY], | 475 | &key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY], |
476 | sizeof(crypto->key)); | 476 | sizeof(crypto->key)); |
477 | 477 | ||
478 | if (key_len > NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY) | 478 | if (key_len > NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY) |
479 | memcpy(&crypto->tx_mic, | 479 | memcpy(crypto->tx_mic, |
480 | &key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY], | 480 | &key[NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY], |
481 | sizeof(crypto->tx_mic)); | 481 | sizeof(crypto->tx_mic)); |
482 | 482 | ||
483 | if (key_len > NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY) | 483 | if (key_len > NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY) |
484 | memcpy(&crypto->rx_mic, | 484 | memcpy(crypto->rx_mic, |
485 | &key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY], | 485 | &key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY], |
486 | sizeof(crypto->rx_mic)); | 486 | sizeof(crypto->rx_mic)); |
487 | } | 487 | } |
@@ -532,7 +532,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
532 | if (crypto.cipher == CIPHER_TKIP) | 532 | if (crypto.cipher == CIPHER_TKIP) |
533 | memcpy_tkip(&crypto, &key->key[0], key->keylen); | 533 | memcpy_tkip(&crypto, &key->key[0], key->keylen); |
534 | else | 534 | else |
535 | memcpy(&crypto.key, &key->key[0], key->keylen); | 535 | memcpy(crypto.key, &key->key[0], key->keylen); |
536 | /* | 536 | /* |
537 | * Each BSS has a maximum of 4 shared keys. | 537 | * Each BSS has a maximum of 4 shared keys. |
538 | * Shared key index values: | 538 | * Shared key index values: |