alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
	Sangbeom Kim <sbkim73@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [RFT v2 1/3] ASoC: samsung: Fix possible double iounmap on s3c24xx driver probe failure
Date: Fri, 28 Jul 2017 10:09:29 +0530	[thread overview]
Message-ID: <dcf5979c-cb10-cf4d-c4d4-eb7800abf038@gmail.com> (raw)
In-Reply-To: <20170727171338.13300-2-krzk@kernel.org>



On Thursday 27 July 2017 10:43 PM, Krzysztof Kozlowski wrote:
> Commit 87b132bc0315 ("ASoC: samsung: s3c24{xx,12}-i2s: port to use
> generic dmaengine API") moved ioremap() call from
> s3c-i2s-v2.c:s3c_i2sv2_probe() to s3c2412-i2s.c:s3c2412_iis_dev_probe()
> and converted it to devm- resource managed interface.
>
> However the error path in first of them - s3c_i2sv2_probe() - was not
> updated.  If getting a iis clock in s3c_i2sv2_probe() failed, the
> address space would be unmapped there.  This could lead to:
> 1. double iounmap() later from devm-interface of s3c2412_iis_dev_probe()),
> 2. accessing the memory by other functions in s3c2412-i2s.c unit.
>
> Anyway, the owner of this mapped region should be s3c2412-i2s.c because
> it starts the mapping.
>
> Affected are drivers for S3C24xx family although issue was not reproduced.
>
> Fixes: 87b132bc0315 ("ASoC: samsung: s3c24{xx,12}-i2s: port to use generic dmaengine API")
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Arvind Yadav<arvind.yadav.cs@gmail.com>
> ---
>
> Not marking as Cc-stable because this is theoretical problem, not
> reproduced and also not tested.
>
> Please, kindly test on S3C24xx hardware.
>
> Changes since v1:
> 1. None
> ---
>   sound/soc/samsung/s3c-i2s-v2.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c
> index ca522a95160b..9b28046eea8e 100644
> --- a/sound/soc/samsung/s3c-i2s-v2.c
> +++ b/sound/soc/samsung/s3c-i2s-v2.c
> @@ -634,7 +634,6 @@ int s3c_i2sv2_probe(struct snd_soc_dai *dai,
>   	i2s->iis_pclk = clk_get(dev, "iis");
>   	if (IS_ERR(i2s->iis_pclk)) {
>   		dev_err(dev, "failed to get iis_clock\n");
> -		iounmap(i2s->regs);
>   		return -ENOENT;
>   	}
>   

  reply	other threads:[~2017-07-28  4:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 17:13 [RFT v2 0/3] ASoC: samsung: s3c24xx: Fixes for error paths Krzysztof Kozlowski
2017-07-27 17:13 ` [RFT v2 1/3] ASoC: samsung: Fix possible double iounmap on s3c24xx driver probe failure Krzysztof Kozlowski
2017-07-28  4:39   ` Arvind Yadav [this message]
2017-07-27 17:13 ` [RFT v2 2/3] ASoC: samsung: Add missing prepare for iis clock of s3c24xx Krzysztof Kozlowski
2017-07-28  4:41   ` Arvind Yadav
2017-07-28  5:44     ` Krzysztof Kozlowski
2017-07-28  6:05       ` Arvind Yadav
2017-07-28 10:18   ` Applied "ASoC: samsung: Add missing prepare for iis clock of s3c24xx" to the asoc tree Mark Brown
2017-07-27 17:13 ` [RFT v2 3/3] ASoC: samsung: Add proper error paths to s3c24xx I2S driver Krzysztof Kozlowski
2017-07-28  4:47   ` Arvind Yadav
2017-07-28 10:17   ` Applied "ASoC: samsung: Add proper error paths to s3c24xx I2S driver" to the asoc 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=dcf5979c-cb10-cf4d-c4d4-eb7800abf038@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=s.nawrocki@samsung.com \
    --cc=sbkim73@samsung.com \
    --cc=tiwai@suse.com \
    /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).