mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Jiajun Cao <jjcao20@fudan.edu.cn>
Cc: yuanxzhang@fudan.edu.cn, Xin Tan <tanxin.ctf@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Dmitry Osipenko <digetx@gmail.com>,
	Mohan Kumar <mkumard@nvidia.com>,
	Peter Geis <pgwipeout@gmail.com>,
	alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pci: hda: Add IRQ check for platform_get_irq()
Date: Tue, 22 Jun 2021 16:08:48 +0200	[thread overview]
Message-ID: <YNHu8GxbzYStfj4W@orome.fritz.box> (raw)
In-Reply-To: <20210622131947.94346-1-jjcao20@fudan.edu.cn>

[-- Attachment #1: Type: text/plain, Size: 847 bytes --]

On Tue, Jun 22, 2021 at 09:19:42PM +0800, Jiajun Cao wrote:
> The function hda_tegra_first_init() neglects to check the return
> value after executing platform_get_irq().
> 
> hda_tegra_first_init() should check the return value (if negative
> error number) for errors so as to not pass a negative value to
> the devm_request_irq().
> 
> Fix it by adding a check for the return value irq_id.
> 
> Signed-off-by: Jiajun Cao <jjcao20@fudan.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
> ---
>  sound/pci/hda/hda_tegra.c | 3 +++
>  1 file changed, 3 insertions(+)

The original code is probably harmless because it looks like the call to
request_irq() would return -EINVAL if irq_id was a negative error code.

But checking the return value is still a good idea, so:

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-06-22 14:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 13:19 Jiajun Cao
2021-06-22 14:08 ` Thierry Reding [this message]
2021-06-22 14:12 ` Takashi Iwai

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=YNHu8GxbzYStfj4W@orome.fritz.box \
    --to=thierry.reding@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=digetx@gmail.com \
    --cc=jjcao20@fudan.edu.cn \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkumard@nvidia.com \
    --cc=perex@perex.cz \
    --cc=pgwipeout@gmail.com \
    --cc=tanxin.ctf@gmail.com \
    --cc=tiwai@suse.com \
    --cc=yuanxzhang@fudan.edu.cn \
    /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

all inboxes | Powered by JetHome®