ASoC: rsnd: ignore runtime NULL case at rsnd_runtime_channel_original_with_params()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 27 May 2021 02:40:34 +0000 (11:40 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 27 May 2021 10:15:26 +0000 (11:15 +0100)
runtime might be NULL. Let's ignore such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <875yz4nbkt.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/core.c

index 8696a99..eef4f77 100644 (file)
@@ -267,8 +267,9 @@ int rsnd_runtime_channel_original_with_params(struct rsnd_dai_stream *io,
         */
        if (params)
                return params_channels(params);
-       else
+       else if (runtime)
                return runtime->channels;
+       return 0;
 }
 
 int rsnd_runtime_channel_after_ctu_with_params(struct rsnd_dai_stream *io,