diff options
| author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-01-13 02:42:53 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2017-01-17 12:58:51 -0500 |
| commit | 72bc7ae0633e2b580217d254114ac6650380b7f6 (patch) | |
| tree | 123cbc06ba55dbe34bf0ea7ea6c16f788c082720 | |
| parent | 3d63a47a380a873408dad10ca62bd8299b2208f1 (diff) | |
spi: s3c64xx: potential oops on probe error
We accidentally mixed up freeing the rx and tx channels which would a
leak and an oops.
Fixes: 3d63a47a380a ("spi: s3c64xx: Don't request/release DMA channels for each SPI transfer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | drivers/spi/spi-s3c64xx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 849ee82483e4..b8cd356d8d10 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
| @@ -1147,7 +1147,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) | |||
| 1147 | if (IS_ERR(sdd->tx_dma.ch)) { | 1147 | if (IS_ERR(sdd->tx_dma.ch)) { |
| 1148 | dev_err(&pdev->dev, "Failed to get TX DMA channel\n"); | 1148 | dev_err(&pdev->dev, "Failed to get TX DMA channel\n"); |
| 1149 | ret = PTR_ERR(sdd->tx_dma.ch); | 1149 | ret = PTR_ERR(sdd->tx_dma.ch); |
| 1150 | goto err_release_tx_dma; | 1150 | goto err_release_rx_dma; |
| 1151 | } | 1151 | } |
| 1152 | } | 1152 | } |
| 1153 | 1153 | ||
| @@ -1197,10 +1197,10 @@ err_pm_put: | |||
| 1197 | pm_runtime_set_suspended(&pdev->dev); | 1197 | pm_runtime_set_suspended(&pdev->dev); |
| 1198 | 1198 | ||
| 1199 | if (!is_polling(sdd)) | 1199 | if (!is_polling(sdd)) |
| 1200 | dma_release_channel(sdd->rx_dma.ch); | ||
| 1201 | err_release_tx_dma: | ||
| 1202 | if (!is_polling(sdd)) | ||
| 1203 | dma_release_channel(sdd->tx_dma.ch); | 1200 | dma_release_channel(sdd->tx_dma.ch); |
| 1201 | err_release_rx_dma: | ||
| 1202 | if (!is_polling(sdd)) | ||
| 1203 | dma_release_channel(sdd->rx_dma.ch); | ||
| 1204 | err_disable_io_clk: | 1204 | err_disable_io_clk: |
| 1205 | clk_disable_unprepare(sdd->ioclk); | 1205 | clk_disable_unprepare(sdd->ioclk); |
| 1206 | err_disable_src_clk: | 1206 | err_disable_src_clk: |
