]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: rsnd: core.c: add WARN_ON() on rsnd_channel_normalization()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 28 Oct 2019 05:29:55 +0000 (14:29 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 28 Oct 2019 14:29:48 +0000 (14:29 +0000)
chan > 8 or chan < 0 shouldn't happen.
This patch uses WARN_ON() for such case.

Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2x530a4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/core.c

index 72924c8b06962408fb7d5547fb5375dfc0b5cbc2..871afe75ca42c6b21582ee1965af65934cf86d29 100644 (file)
@@ -302,7 +302,7 @@ int rsnd_runtime_channel_after_ctu_with_params(struct rsnd_dai_stream *io,
 
 int rsnd_channel_normalization(int chan)
 {
-       if ((chan > 8) || (chan < 0))
+       if (WARN_ON((chan > 8) || (chan < 0)))
                return 0;
 
        /* TDM Extend Mode needs 8ch */