From: Takashi Iwai <tiwai@suse.de>
To: Greg Thelen <gthelen@google.com>
Cc: Jaroslav Kysela <perex@perex.cz>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hda: check make_exec_verb() return value
Date: Mon, 13 Jun 2011 17:52:46 +0200 [thread overview]
Message-ID: <s5hoc21enjl.wl%tiwai@suse.de> (raw)
In-Reply-To: <1307976345-13258-1-git-send-email-gthelen@google.com>
At Mon, 13 Jun 2011 07:45:45 -0700,
Greg Thelen wrote:
>
> If given a -1 cmd parameter then make_exec_verb() returns -1 without
> setting the res output value.
>
> Prior to this change snd_hda_codec_read() assumed that make_exec_verb()
> unconditionally set res regardless of the cmd value.
>
> This change explicitly checks the make_exec_verb() return value before
> consuming the potentially unset res value.
>
> Signed-off-by: Greg Thelen <gthelen@google.com>
Applied now. Thanks.
Takashi
> ---
> sound/pci/hda/hda_codec.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index 45b4a8d..f06dd5f 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -243,7 +243,8 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid,
> {
> unsigned cmd = make_codec_cmd(codec, nid, direct, verb, parm);
> unsigned int res;
> - codec_exec_verb(codec, cmd, &res);
> + if (codec_exec_verb(codec, cmd, &res))
> + return -1;
> return res;
> }
> EXPORT_SYMBOL_HDA(snd_hda_codec_read);
> --
> 1.7.3.1
>
prev parent reply other threads:[~2011-06-13 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-13 14:45 Greg Thelen
2011-06-13 15:52 ` Takashi Iwai [this message]
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=s5hoc21enjl.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=gthelen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
/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®