提交 e076eb5c 编写于 作者: W Wang Xingchao 提交者: Takashi Iwai

ALSA: hda - check proper return value

snd_hda_param_read() return value -1 means error, others are responses
Signed-off-by: NWang Xingchao <xingchao.wang@intel.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 0f4ccbb0
......@@ -451,7 +451,7 @@ static void print_power_state(struct snd_info_buffer *buffer,
int sup = snd_hda_param_read(codec, nid, AC_PAR_POWER_STATE);
int pwr = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_POWER_STATE, 0);
if (sup)
if (sup != -1)
snd_iprintf(buffer, " Power states: %s\n",
bits_names(sup, names, ARRAY_SIZE(names)));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册