[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210709131555.988089047@linuxfoundation.org>
Date: Fri, 9 Jul 2021 15:21:41 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Lorenzo Bianconi <lorenzo@...nel.org>,
Felix Fietkau <nbd@....name>, Deren Wu <Deren.Wu@...iatek.com>
Subject: [PATCH 5.12 04/11] mt76: mt7921: check mcu returned values in mt7921_start
From: Lorenzo Bianconi <lorenzo@...nel.org>
commit f92f81d35ac26f8a519866f1b561743fe70e33a5 upstream.
Properly check returned values from mcu utility routines in
mt7921_start.
Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
Signed-off-by: Felix Fietkau <nbd@....name>
Cc: Deren Wu <Deren.Wu@...iatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/net/wireless/mediatek/mt76/mt7921/main.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -172,22 +172,31 @@ static int mt7921_start(struct ieee80211
{
struct mt7921_dev *dev = mt7921_hw_dev(hw);
struct mt7921_phy *phy = mt7921_hw_phy(hw);
+ int err;
mt7921_mutex_acquire(dev);
- mt76_connac_mcu_set_mac_enable(&dev->mt76, 0, true, false);
- mt76_connac_mcu_set_channel_domain(phy->mt76);
+ err = mt76_connac_mcu_set_mac_enable(&dev->mt76, 0, true, false);
+ if (err)
+ goto out;
+
+ err = mt76_connac_mcu_set_channel_domain(phy->mt76);
+ if (err)
+ goto out;
+
+ err = mt7921_mcu_set_chan_info(phy, MCU_EXT_CMD_SET_RX_PATH);
+ if (err)
+ goto out;
- mt7921_mcu_set_chan_info(phy, MCU_EXT_CMD_SET_RX_PATH);
mt7921_mac_reset_counters(phy);
set_bit(MT76_STATE_RUNNING, &phy->mt76->state);
ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work,
MT7921_WATCHDOG_TIME);
-
+out:
mt7921_mutex_release(dev);
- return 0;
+ return err;
}
static void mt7921_stop(struct ieee80211_hw *hw)
Powered by blists - more mailing lists