• Arnd Bergmann's avatar
    ALSA: hda/ca0132 - fix possible NULL pointer use · 46a049da
    Arnd Bergmann authored
    gcc-7 caught what it considers a NULL pointer dereference:
    
    sound/pci/hda/patch_ca0132.c: In function 'dspio_scp.constprop':
    sound/pci/hda/patch_ca0132.c:1487:4: error: argument 1 null where non-null expected [-Werror=nonnull]
    
    This is plausible from looking at the function, as we compare 'reply'
    to NULL earlier in it. I have not tried to analyze if there are constraints
    that make it impossible to hit the bug, but adding another NULL check in
    the end kills the warning and makes the function more robust.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    46a049da
patch_ca0132.c 125 KB