• Arnd Bergmann's avatar
    ALSA: au88x0: avoid theoretical uninitialized access · 13f99ebd
    Arnd Bergmann authored
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    13f99ebd
au88x0_core.c 77.5 KB