Re: [patch] spi: s3c64xx: potential oops on probe error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 13, 2017 at 10:42:53AM +0300, Dan Carpenter wrote:
> 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@xxxxxxxxxx>

Thanks, Dan.

Acked-by: Andi Shyti <andi.shyti@xxxxxxxxxxx>

Andi

> 
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index 849ee82..b8cd356 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;
>  		}
>  	}
>  
> @@ -1197,10 +1197,10 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
>  	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:
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux