From mboxrd@z Thu Jan 1 00:00:00 1970 From: arvindY Date: Sat, 09 Dec 2017 13:45:56 +0000 Subject: Re: [PATCH 1/2] ASoC: nuc900: Fix platform_get_irq() error checking some more Message-Id: <5A2BE644.3070009@gmail.com> List-Id: References: <20171209115203.pdtdfnmzwz6zpjqs@mwanda> In-Reply-To: <20171209115203.pdtdfnmzwz6zpjqs@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter , Liam Girdwood Cc: Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org Hi Dan, On Saturday 09 December 2017 05:22 PM, Dan Carpenter wrote: > The error handling doesn't work here because "nuc900_audio->irq_num" is > unsigned. Also we should be checking for < 0 and not <= 0 but I believe > that's harmless. The platform_get_irq() comments don't talk about the > return values... Sorry for this patch. I will fix it and send you updated patch. Thanks for point it. > Fixes: fa8cc38165c2 ("ASoC: nuc900: Fix platform_get_irq's error checking") > Signed-off-by: Dan Carpenter > > diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c > index 5e4fbd2d3479..71fce7c85c93 100644 > --- a/sound/soc/nuc900/nuc900-ac97.c > +++ b/sound/soc/nuc900/nuc900-ac97.c > @@ -345,11 +345,10 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev) > goto out; > } > > - nuc900_audio->irq_num = platform_get_irq(pdev, 0); > - if (nuc900_audio->irq_num <= 0) { > - ret = nuc900_audio->irq_num < 0 ? nuc900_audio->irq_num : -EBUSY; > + ret = platform_get_irq(pdev, 0); > + if (ret < 0) > goto out; > - } > + nuc900_audio->irq_num = ret; > > nuc900_ac97_data = nuc900_audio; > ~arvind From mboxrd@z Thu Jan 1 00:00:00 1970 From: arvindY Subject: Re: [PATCH 1/2] ASoC: nuc900: Fix platform_get_irq() error checking some more Date: Sat, 9 Dec 2017 19:03:56 +0530 Message-ID: <5A2BE644.3070009@gmail.com> References: <20171209115203.pdtdfnmzwz6zpjqs@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20171209115203.pdtdfnmzwz6zpjqs@mwanda> Sender: kernel-janitors-owner@vger.kernel.org To: Dan Carpenter , Liam Girdwood Cc: Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org List-Id: alsa-devel@alsa-project.org Hi Dan, On Saturday 09 December 2017 05:22 PM, Dan Carpenter wrote: > The error handling doesn't work here because "nuc900_audio->irq_num" is > unsigned. Also we should be checking for < 0 and not <= 0 but I believe > that's harmless. The platform_get_irq() comments don't talk about the > return values... Sorry for this patch. I will fix it and send you updated patch. Thanks for point it. > Fixes: fa8cc38165c2 ("ASoC: nuc900: Fix platform_get_irq's error checking") > Signed-off-by: Dan Carpenter > > diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c > index 5e4fbd2d3479..71fce7c85c93 100644 > --- a/sound/soc/nuc900/nuc900-ac97.c > +++ b/sound/soc/nuc900/nuc900-ac97.c > @@ -345,11 +345,10 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev) > goto out; > } > > - nuc900_audio->irq_num = platform_get_irq(pdev, 0); > - if (nuc900_audio->irq_num <= 0) { > - ret = nuc900_audio->irq_num < 0 ? nuc900_audio->irq_num : -EBUSY; > + ret = platform_get_irq(pdev, 0); > + if (ret < 0) > goto out; > - } > + nuc900_audio->irq_num = ret; > > nuc900_ac97_data = nuc900_audio; > ~arvind