Commit cb47c7be authored by Muhammad Usama Anjum's avatar Muhammad Usama Anjum Committed by Felix Fietkau

wifi: mt76: connac: check for null before dereferencing

The wcid can be NULL. It should be checked for validity before
dereferencing it to avoid crash.

Fixes: 098428c4 ("wifi: mt76: connac: set correct muar_idx for mt799x chipsets")
Signed-off-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 21de5f72
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment