]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: mt76: mt7996: prevent uninit return in mt7996_mac_sta_add_links
authorQasim Ijaz <qasdev00@gmail.com>
Mon, 21 Apr 2025 11:05:50 +0000 (12:05 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 21 May 2025 12:49:38 +0000 (14:49 +0200)
commitd9bc625861d490cb76ae8af86fac6f8ab0655a18
treeb5c4824cb29f5e5070b2a6978e5e965c5859ee0b
parent3dbfb8abe3fd3fff81a95bd8ac2a48741f63e872
wifi: mt76: mt7996: prevent uninit return in mt7996_mac_sta_add_links

If link_conf_dereference_protected() or mt7996_vif_link()
or link_sta_dereference_protected() fail the code jumps to
the error_unlink label and returns ret which is uninitialised.

Fix this by setting err before jumping to error_unlink.

Fixes: c7e4fc362443 ("wifi: mt76: mt7996: Update mt7996_mcu_add_sta to MLO support")
Fixes: dd82a9e02c05 ("wifi: mt76: mt7996: Rely on mt7996_sta_link in sta_add/sta_remove callbacks")
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Link: https://patch.msgid.link/20250421110550.9839-1-qasdev00@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7996/main.c