summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Usama Anjum <usama.anjum@collabora.com>2024-03-01 17:44:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-30 10:44:29 +0300
commite469218765b2781fb968778bd13595acec181a0e (patch)
tree82bd30bbc813693c5ed1f3df8d42b5dfd05485ea
parentef22ea3405527ab167fe1ca0bd4dd62e9926c393 (diff)
downloadlinux-e469218765b2781fb968778bd13595acec181a0e.tar.xz
wifi: mt76: connac: check for null before dereferencing
[ Upstream commit cb47c7be0e93dd5acda078163799401ac3a78e10 ] The wcid can be NULL. It should be checked for validity before dereferencing it to avoid crash. Fixes: 098428c400ff ("wifi: mt76: connac: set correct muar_idx for mt799x chipsets") Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
index af0c2b2aacb0..7af60eebe517 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
@@ -283,7 +283,7 @@ __mt76_connac_mcu_alloc_sta_req(struct mt76_dev *dev, struct mt76_vif *mvif,
};
struct sk_buff *skb;
- if (is_mt799x(dev) && !wcid->sta)
+ if (is_mt799x(dev) && wcid && !wcid->sta)
hdr.muar_idx = 0xe;
mt76_connac_mcu_get_wlan_idx(dev, wcid, &hdr.wlan_idx_lo,