]> asedeno.scripts.mit.edu Git - linux.git/commit
ALSA: hda/ca0132 - fix possible NULL pointer use
authorArnd Bergmann <arnd@arndb.de>
Wed, 11 Jan 2017 13:39:44 +0000 (14:39 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 11 Jan 2017 16:19:23 +0000 (17:19 +0100)
commit46a049dae771b95e77ac6c823330f4a60f600236
tree8620694d4b704e717517c9730145d76bc68fd9a5
parent921282360b9c9bf34c75cd18bb90f298c4f4ebc8
ALSA: hda/ca0132 - fix possible NULL pointer use

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: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_ca0132.c