From: Dan Carpenter Date: Fri, 13 Jan 2017 07:42:53 +0000 (+0300) Subject: spi: s3c64xx: potential oops on probe error X-Git-Tag: v4.11-rc1~153^2~1^4 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=72bc7ae0633e2b580217d254114ac6650380b7f6;p=linux.git 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 Acked-by: Marek Szyprowski Acked-by: Andi Shyti Signed-off-by: Mark Brown --- 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) if (IS_ERR(sdd->tx_dma.ch)) { dev_err(&pdev->dev, "Failed to get TX DMA channel\n"); ret = PTR_ERR(sdd->tx_dma.ch); - goto err_release_tx_dma; + goto err_release_rx_dma; } } @@ -1196,11 +1196,11 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); - if (!is_polling(sdd)) - dma_release_channel(sdd->rx_dma.ch); -err_release_tx_dma: if (!is_polling(sdd)) dma_release_channel(sdd->tx_dma.ch); +err_release_rx_dma: + if (!is_polling(sdd)) + dma_release_channel(sdd->rx_dma.ch); err_disable_io_clk: clk_disable_unprepare(sdd->ioclk); err_disable_src_clk: