]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: uniphier-sd: Fix an error handling path in uniphier_sd_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 20 Feb 2021 14:29:35 +0000 (15:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 06:39:30 +0000 (08:39 +0200)
commit b03aec1c1f337dfdae44cdb0645ecac34208ae0a upstream.

A 'uniphier_sd_clk_enable()' call should be balanced by a corresponding
'uniphier_sd_clk_disable()' call.
This is done in the remove function, but not in the error handling path of
the probe.

Add the missing call.

Fixes: 3fd784f745dd ("mmc: uniphier-sd: add UniPhier SD/eMMC controller driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20210220142935.918554-1-christophe.jaillet@wanadoo.fr
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/uniphier-sd.c

index 2413b6750cec3c79ca6c9bbdd716446a0d8a7f83..6f0f05466917ee2d551ab3b2246398d4df6b1c70 100644 (file)
@@ -635,7 +635,7 @@ static int uniphier_sd_probe(struct platform_device *pdev)
 
        ret = tmio_mmc_host_probe(host);
        if (ret)
-               goto free_host;
+               goto disable_clk;
 
        ret = devm_request_irq(dev, irq, tmio_mmc_irq, IRQF_SHARED,
                               dev_name(dev), host);
@@ -646,6 +646,8 @@ static int uniphier_sd_probe(struct platform_device *pdev)
 
 remove_host:
        tmio_mmc_host_remove(host);
+disable_clk:
+       uniphier_sd_clk_disable(host);
 free_host:
        tmio_mmc_host_free(host);