wifi: mt76: connac: check for null before dereferencing
authorMuhammad Usama Anjum <usama.anjum@collabora.com>
Fri, 1 Mar 2024 14:44:06 +0000 (19:44 +0500)
committerFelix Fietkau <nbd@nbd.name>
Thu, 2 May 2024 10:44:50 +0000 (12:44 +0200)
commitcb47c7be0e93dd5acda078163799401ac3a78e10
tree77704de53b17a7cf0260575508d6e2ea70ec9fd0
parent21de5f72260b4246e2415bc900c18139bc52ea80
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: 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>
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c