From: Qinglang Miao Date: Tue, 3 Nov 2020 07:49:12 +0000 (+0800) Subject: spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe X-Git-Tag: v5.11-rc1~158^2^2~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=702b15cb9712;p=thirdparty%2Fkernel%2Flinux.git spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe Fix the missing clk_disable_unprepare() before return from mt7621_spi_probe in the error handling case. Fixes: cbd66c626e16 ("spi: mt7621: Move SPI driver out of staging") Signed-off-by: Qinglang Miao Link: https://lore.kernel.org/r/20201103074912.195576-1-miaoqinglang@huawei.com Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-mt7621.c b/drivers/spi/spi-mt7621.c index 2c3b7a2a1ec77..2cdae7994e2aa 100644 --- a/drivers/spi/spi-mt7621.c +++ b/drivers/spi/spi-mt7621.c @@ -353,6 +353,7 @@ static int mt7621_spi_probe(struct platform_device *pdev) master = spi_alloc_master(&pdev->dev, sizeof(*rs)); if (!master) { dev_info(&pdev->dev, "master allocation failed\n"); + clk_disable_unprepare(clk); return -ENOMEM; } @@ -377,6 +378,7 @@ static int mt7621_spi_probe(struct platform_device *pdev) ret = device_reset(&pdev->dev); if (ret) { dev_err(&pdev->dev, "SPI reset failed!\n"); + clk_disable_unprepare(clk); return ret; }