diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-04-17 09:19:46 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-04-17 09:32:17 -0400 |
commit | f4d770317997f89bb6997ee3e8dd495cb8356ae9 (patch) | |
tree | c77e1d3c7907079d5bbdaaa2ff3b3e48107d6881 | |
parent | 7d4b5e978ad350916b5c3995490b09c4e59cec4a (diff) |
ALSA: hda - potential (but unlikely) uninitialized variable
This function is a bit unusual because it accepts negative values as
"conn_len". It's theoretically possible for both "cache_len" and
"conn_len" to be -ENOSPC and in that case we would oops trying to run
memcmp() on the uninitialized "list" pointer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index ee6230767c64..baaf7ed06875 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -582,8 +582,8 @@ static void print_conn_list(struct snd_info_buffer *buffer, | |||
582 | 582 | ||
583 | /* Get Cache connections info */ | 583 | /* Get Cache connections info */ |
584 | cache_len = snd_hda_get_conn_list(codec, nid, &list); | 584 | cache_len = snd_hda_get_conn_list(codec, nid, &list); |
585 | if (cache_len != conn_len | 585 | if (cache_len >= 0 && (cache_len != conn_len || |
586 | || memcmp(list, conn, conn_len)) { | 586 | memcmp(list, conn, conn_len) != 0)) { |
587 | snd_iprintf(buffer, " In-driver Connection: %d\n", cache_len); | 587 | snd_iprintf(buffer, " In-driver Connection: %d\n", cache_len); |
588 | if (cache_len > 0) { | 588 | if (cache_len > 0) { |
589 | snd_iprintf(buffer, " "); | 589 | snd_iprintf(buffer, " "); |