This is a note to let you know that I've just added the patch titled mt76: mt7921s: fix a possible memory leak in mt7921_load_patch to the 5.17-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mt76-mt7921s-fix-a-possible-memory-leak-in-mt7921_lo.patch and it can be found in the queue-5.17 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit d5a16cca584cbd668da15f8a794bc1e4225ad414 Author: Lorenzo Bianconi <lorenzo@xxxxxxxxxx> Date: Mon Jan 24 21:03:44 2022 +0100 mt76: mt7921s: fix a possible memory leak in mt7921_load_patch [ Upstream commit 11005b18f453aa192d035d410c11d07edcba5a45 ] Always release fw data at the end of mt7921_load_patch routine. Fixes: 78b217580c509 ("mt76: mt7921s: fix bus hang with wrong privilege") Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx> Signed-off-by: Felix Fietkau <nbd@xxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index 152e7579f77d..e82545a7fcc1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -707,12 +707,8 @@ static int mt7921_load_patch(struct mt7921_dev *dev) if (mt76_is_sdio(&dev->mt76)) { /* activate again */ ret = __mt7921_mcu_fw_pmctrl(dev); - if (ret) - return ret; - - ret = __mt7921_mcu_drv_pmctrl(dev); - if (ret) - return ret; + if (!ret) + ret = __mt7921_mcu_drv_pmctrl(dev); } out: