Skip to content

Commit

Permalink
spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qs…
Browse files Browse the repository at this point in the history
…pi_probe()

[ Upstream commit ca9b8f5 ]

Fix the missing clk_disable_unprepare() before return
from bcm_qspi_probe() in the error handling case.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211018073413.2029081-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yang Yingliang authored and Sasha Levin committed Nov 21, 2021
1 parent 25cc7c3 commit 0161ff4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/spi/spi-bcm-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
&qspi->dev_ids[val]);
if (ret < 0) {
dev_err(&pdev->dev, "IRQ %s not found\n", name);
goto qspi_probe_err;
goto qspi_unprepare_err;
}

qspi->dev_ids[val].dev = qspi;
Expand All @@ -1316,7 +1316,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
if (!num_ints) {
dev_err(&pdev->dev, "no IRQs registered, cannot init driver\n");
ret = -EINVAL;
goto qspi_probe_err;
goto qspi_unprepare_err;
}

/*
Expand Down Expand Up @@ -1367,6 +1367,7 @@ int bcm_qspi_probe(struct platform_device *pdev,

qspi_reg_err:
bcm_qspi_hw_uninit(qspi);
qspi_unprepare_err:
clk_disable_unprepare(qspi->clk);
qspi_probe_err:
kfree(qspi->dev_ids);
Expand Down

0 comments on commit 0161ff4

Please sign in to comment.