]> git.itanic.dy.fi Git - linux-stable/commit
ASoC: Intel: Boards: Fix NULL pointer deref in BYT/CHT boards
authorHans de Goede <hdegoede@redhat.com>
Sat, 10 Feb 2024 13:43:59 +0000 (14:43 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 11 Feb 2024 16:57:23 +0000 (16:57 +0000)
commit7d99a70b65951108d82e1618c67abe69c3ed7720
treeda69b6edd95f074721f6b212b433d53de12461c0
parent727b943263dc98a7aca355cc0302158218f71543
ASoC: Intel: Boards: Fix NULL pointer deref in BYT/CHT boards

Since commit 13f58267cda3 ("ASoC: soc.h: don't create dummy Component
via COMP_DUMMY()") dummy snd_soc_dai_link.codecs entries no longer
have a name set.

This means that when looking for the codec dai_link the machine
driver can no longer unconditionally run strcmp() on
snd_soc_dai_link.codecs[0].name since this may now be NULL.

Add a check for snd_soc_dai_link.codecs[0].name being NULL to all
BYT/CHT machine drivers to avoid NULL pointer dereferences in
their probe() methods.

Fixes: 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240210134400.24913-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bytcht_cx2072x.c
sound/soc/intel/boards/bytcht_da7213.c
sound/soc/intel/boards/bytcht_es8316.c
sound/soc/intel/boards/bytcr_rt5640.c
sound/soc/intel/boards/bytcr_rt5651.c
sound/soc/intel/boards/bytcr_wm5102.c
sound/soc/intel/boards/cht_bsw_rt5645.c
sound/soc/intel/boards/cht_bsw_rt5672.c