diff mbox series

[1/4] wifi: mt76: handle possible error returned by sdio_set_host_pm_flags()

Message ID 20230801050000.18864-1-dmantipov@yandex.ru (mailing list archive)
State New
Delegated to: Felix Fietkau
Headers show
Series [1/4] wifi: mt76: handle possible error returned by sdio_set_host_pm_flags() | expand

Commit Message

Dmitry Antipov Aug. 1, 2023, 4:57 a.m. UTC
In 'mt7663s_suspend()', drop nested declaration of 'err' and
handle possible error returned by 'sdio_set_host_pm_flags()'.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/mediatek/mt76/mt7615/sdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
index fc547a0031ea..6607577d22cf 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
@@ -188,14 +188,14 @@  static int mt7663s_suspend(struct device *dev)
 
 	if (!test_bit(MT76_STATE_SUSPEND, &mdev->mphy.state) &&
 	    mt7615_firmware_offload(mdev)) {
-		int err;
-
 		err = mt76_connac_mcu_set_hif_suspend(&mdev->mt76, true);
 		if (err < 0)
 			return err;
 	}
 
-	sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
+	err = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
+	if (err)
+		return err;
 
 	err = mt7615_mcu_set_fw_ctrl(mdev);
 	if (err)