Revert "wifi: mt76: Check link_conf pointer in mt76_connac_mcu_sta_basic_tlv()"
authorLorenzo Bianconi <lorenzo@kernel.org>
Tue, 25 Mar 2025 16:12:05 +0000 (17:12 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 21 May 2025 12:49:39 +0000 (14:49 +0200)
In mt76_connac_mcu_sta_basic_tlv() link_conf is always not NULL.
Revert the commit '9890624c1b39 ("wifi: mt76: Check link_conf pointer in
mt76_connac_mcu_sta_basic_tlv()")' in order to fix the following
warning:

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c:394 mt76_connac_mcu_sta_basic_tlv()
warn: variable dereferenced before check 'link_conf'

This reverts commit 9890624c1b3948c1c7f1d0e19ef0bb7680b8c80d.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20250325-mt76_connac_mcu_sta_basic_tlv-link_conf-revert-v1-1-b84efefb74ee@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c

index 185ba57d416dc17b91a02d3d29f5ba6697bf20f7..5f79a7f083d2b6522f3f66df8be4826577c79846 100644 (file)
@@ -390,7 +390,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
                basic->conn_type = cpu_to_le32(CONNECTION_INFRA_BC);
 
                if (vif->type == NL80211_IFTYPE_STATION &&
-                   link_conf && !is_zero_ether_addr(link_conf->bssid)) {
+                   !is_zero_ether_addr(link_conf->bssid)) {
                        memcpy(basic->peer_addr, link_conf->bssid, ETH_ALEN);
                        basic->aid = cpu_to_le16(vif->cfg.aid);
                } else {