wifi: rtlwifi: use eth_broadcast_addr() to assign broadcast address
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 4 Aug 2023 09:01:20 +0000 (17:01 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 21 Aug 2023 16:13:00 +0000 (19:13 +0300)
Use eth_broadcast_addr() to assign broadcast address instead
of memcpy().

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230804090120.1332091-1-yangyingliang@huawei.com
drivers/net/wireless/realtek/rtlwifi/core.c

index 4fb16f5..3835b63 100644 (file)
@@ -1656,7 +1656,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, bcast_addr, ETH_ALEN);
+                       eth_broadcast_addr(mac_addr);
                } else {        /* pairwise key */
                        rtl_dbg(rtlpriv, COMP_SEC, DBG_DMESG,
                                "set pairwise key\n");