Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751719AbdG1EkS (ORCPT ); Fri, 28 Jul 2017 00:40:18 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33001 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751656AbdG1EkQ (ORCPT ); Fri, 28 Jul 2017 00:40:16 -0400 Subject: Re: [RFT v2 1/3] ASoC: samsung: Fix possible double iounmap on s3c24xx driver probe failure To: Krzysztof Kozlowski , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <20170727171338.13300-1-krzk@kernel.org> <20170727171338.13300-2-krzk@kernel.org> From: Arvind Yadav Message-ID: Date: Fri, 28 Jul 2017 10:09:29 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170727171338.13300-2-krzk@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1764 Lines: 47 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 Acked-by: Arvind Yadav > --- > > 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; > } >