]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: rtsx_usb_sdmmc: Fix error-path in sd_set_power_mode()
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 10 Jun 2025 11:16:23 +0000 (13:16 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Jun 2025 10:43:26 +0000 (12:43 +0200)
In the error path of sd_set_power_mode() we don't update host->power_mode,
which could lead to an imbalance of the runtime PM usage count. Fix this by
always updating host->power_mode.

Reviewed-by: Avri Altman <avri.altman@sandisk.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Ricky Wu <ricky_wu@realtek.com>
Link: https://lore.kernel.org/r/20250610111633.504366-2-ulf.hansson@linaro.org
drivers/mmc/host/rtsx_usb_sdmmc.c

index 9c5d695d04b136fc5b6a63b37cf22512908655ab..6f3cfa422f46cdc25a5b9e85e7e8c1376035c4d7 100644 (file)
@@ -1029,9 +1029,7 @@ static int sd_set_power_mode(struct rtsx_usb_sdmmc *host,
                err = sd_power_on(host);
        }
 
-       if (!err)
-               host->power_mode = power_mode;
-
+       host->power_mode = power_mode;
        return err;
 }