ASoC: meson: axg-card: fix null pointer dereference in clean up
authorJerome Brunet <jbrunet@baylibre.com>
Mon, 10 Jun 2019 12:53:44 +0000 (14:53 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 10 Jun 2019 14:39:26 +0000 (15:39 +0100)
commit960f428ca0a04a59e74639571126245a3efc4bcf
tree818c084d09d81506e69bd7b45e69487bf81691d0
parent6c0215f5d9f2a1fa5cab2ca320a41d9f19cfa80c
ASoC: meson: axg-card: fix null pointer dereference in clean up

When using modern dai_link style, we must first make sure the
struct snd_soc_dai_link_component exists before accessing its members.

In case of early probe deferral, some of the '.cpus' or '.codecs' may not
have been allocated yet. Check this before calling of_node_put() on the
structure member.

Fixes: c84836d7f650 ("ASoC: meson: axg-card: use modern dai_link style")
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/meson/axg-card.c