]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: mt76: do not increase mcu skb refcount if retry is not supported
authorFelix Fietkau <nbd@nbd.name>
Tue, 17 Sep 2024 11:09:42 +0000 (13:09 +0200)
committerKalle Valo <kvalo@kernel.org>
Wed, 18 Sep 2024 13:34:00 +0000 (16:34 +0300)
commit34b69548108480ebb36cb6a067974a88ec745897
tree79352b123c446db4708d337fe4a104e9aa6a26da
parent5575058ba95bb016243e54e5ca3371b9884ded56
wifi: mt76: do not increase mcu skb refcount if retry is not supported

If mcu_skb_prepare_msg is not implemented, incrementing skb refcount does not
work for mcu message retry. In some cases (e.g. on SDIO), shared skbs can trigger
a BUG_ON, crashing the system.
Fix this by only incrementing refcount if retry is actually supported.

Fixes: 3688c18b65ae ("wifi: mt76: mt7915: retry mcu messages")
Closes: https://lore.kernel.org/r/d907b13a-f8be-4cb8-a0bb-560a21278041@notapiano/
Reported-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com> #KernelCI
Tested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240917110942.22077-1-nbd@nbd.name
drivers/net/wireless/mediatek/mt76/mcu.c