]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: au88x0: avoid theoretical uninitialized access
authorArnd Bergmann <arnd@arndb.de>
Thu, 23 Mar 2017 15:15:55 +0000 (16:15 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 24 Mar 2017 10:59:51 +0000 (11:59 +0100)
commitf4d8ca5c370ad824309a319ec21566046a8b2f58
tree8677fa5731adc91e59e1b4b8a67422159f638e28
parent543aea535b2b387dcc211602193268b9f9f358b0
ALSA: au88x0: avoid theoretical uninitialized access

The latest gcc-7.0.1 snapshot points out that we if nr_ch is zero, we never
initialize some variables:

sound/pci/au88x0/au88x0_core.c: In function 'vortex_adb_allocroute':
sound/pci/au88x0/au88x0_core.c:2304:68: error: 'mix[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
sound/pci/au88x0/au88x0_core.c:2305:58: error: 'src[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I assume this can never happen in practice, but adding a check here doesn't
hurt either and avoids the warning. The code has been unchanged since
the start of git history.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/au88x0/au88x0_core.c