Skip to content

Commit

Permalink
ALSA: hda - check proper return value
Browse files Browse the repository at this point in the history
snd_hda_param_read() return value -1 means error, others are responses

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Wang Xingchao authored and Takashi Iwai committed Jun 7, 2012
1 parent 0f4ccbb commit e076eb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/pci/hda/hda_proc.c
Original file line number Diff line number Diff line change
@@ -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)));

0 comments on commit e076eb5

Please sign in to comment.