ASoC: simple_card_utils.h: care NULL dai at asoc_simple_debug_dai()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 10 Jul 2019 07:59:55 +0000 (16:59 +0900)
committerMark Brown <broonie@kernel.org>
Wed, 10 Jul 2019 15:25:29 +0000 (16:25 +0100)
props->xxx_dai might be NULL when DPCM.
This patch cares it for debug.

Fixes: commit 0580dde59438 ("ASoC: simple-card-utils: add asoc_simple_debug_info()")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o922gw4u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/simple_card_utils.h

index 954563ee22779741d86d20885a7c4a08abb502cb..985a5f583de4c7f10cf161267cd554999dad4bf8 100644 (file)
@@ -141,6 +141,10 @@ inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
 {
        struct device *dev = simple_priv_to_dev(priv);
 
+       /* dai might be NULL */
+       if (!dai)
+               return;
+
        if (dai->name)
                dev_dbg(dev, "%s dai name = %s\n",
                        name, dai->name);