From: Wang Xingchao Date: Thu, 7 Jun 2012 08:52:07 +0000 (+0800) Subject: ALSA: hda - check proper return value X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=e076eb5c952c0f724980b44a77902a2ff93d098c;p=~shefty%2Frdma-dev.git ALSA: hda - check proper return value snd_hda_param_read() return value -1 means error, others are responses Signed-off-by: Wang Xingchao Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 1dd9dbeeef6..7e46258fc70 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c @@ -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)));