提交 9857edfd 编写于 作者: G Greg Thelen 提交者: Takashi Iwai

ALSA: hda: check make_exec_verb() return value

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: NGreg Thelen <gthelen@google.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 5ab775c7
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册