linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	Andi Shyti <andi.shyti@samsung.com>,
	Mark Brown <broonie@kernel.org>,
	linux-samsung-soc@vger.kernel.org, linux-spi@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] spi: s3c64xx: potential oops on probe error
Date: Fri, 13 Jan 2017 09:52:38 +0100	[thread overview]
Message-ID: <50005d2c-9a1d-45f5-fe6c-7877d35cf442@samsung.com> (raw)
In-Reply-To: <20170113074253.GA30524@mwanda>

Hi Dan,


On 2017-01-13 08:42, 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@oracle.com>

Right, my fault. Thanks for the fix!
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

> 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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

  reply	other threads:[~2017-01-13  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170113074414epcas3p2474dd2512aa5b64989bee3696c7c48f8@epcas3p2.samsung.com>
2017-01-13  7:42 ` [patch] spi: s3c64xx: potential oops on probe error Dan Carpenter
2017-01-13  8:52   ` Marek Szyprowski [this message]
2017-01-13 11:12   ` Andi Shyti
2017-01-17 18:46   ` Applied "spi: s3c64xx: potential oops on probe error" to the spi tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50005d2c-9a1d-45f5-fe6c-7877d35cf442@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=andi.shyti@samsung.com \
    --cc=broonie@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=javier@osg.samsung.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).