ALSA: hda/ca0132 - fix possible NULL pointer use 36/220936/1
authorArnd Bergmann <arnd@arndb.de>
Wed, 11 Jan 2017 13:39:44 +0000 (14:39 +0100)
committerDongkyun Son <dongkyun.s@samsung.com>
Thu, 26 Dec 2019 03:51:35 +0000 (12:51 +0900)
commit709f71896b16ceb2ee767504dfaa05bc8209b9d4
tree573e944362f5bbb1b5724e0e90b3e98224786eaa
parent05c48e0f2449af33d968ea9dd7fa7ccf234d92de
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>
[dongkyun.s: cherry-pick mainline commit 46a049dae771 for gcc 9 build]

Change-Id: Id0faddb2d8b93b5b9aa522ae7ef08c34886df5e6
sound/pci/hda/patch_ca0132.c