diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-11-15 21:24:57 +0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-16 14:29:07 -0500 |
commit | ccd953694bf9ce4639fa4d8bdb8a2a297315816f (patch) | |
tree | 2efda58086940b44897de5ca6c8bba6d6f012c3a /drivers/net/wireless/rtlwifi/core.c | |
parent | 9c033bed936629155129a2b3e7493838fe76b8b5 (diff) |
rtlwifi: use eth_zero_addr() to assign zero address
Using eth_zero_addr() to assign zero address insetad of
memset() or an inefficient copy from a static array.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/core.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c index a7c0e52869ba..be33aa14c8af 100644 --- a/drivers/net/wireless/rtlwifi/core.c +++ b/drivers/net/wireless/rtlwifi/core.c @@ -962,7 +962,6 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, int err = 0; u8 mac_addr[ETH_ALEN]; u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - u8 zero_addr[ETH_ALEN] = { 0 }; if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, @@ -1057,7 +1056,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, memcpy(rtlpriv->sec.key_buf[key_idx], key->key, key->keylen); rtlpriv->sec.key_len[key_idx] = key->keylen; - memcpy(mac_addr, zero_addr, ETH_ALEN); + eth_zero_addr(mac_addr); } else if (group_key) { /* group key */ RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "set group key\n"); @@ -1108,7 +1107,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, } memset(rtlpriv->sec.key_buf[key_idx], 0, key->keylen); rtlpriv->sec.key_len[key_idx] = 0; - memcpy(mac_addr, zero_addr, ETH_ALEN); + eth_zero_addr(mac_addr); /* *mac80211 will delete entrys one by one, *so don't use rtl_cam_reset_all_entry |