From: Kuninori Morimoto Date: Mon, 28 Oct 2019 05:29:55 +0000 (+0900) Subject: ASoC: rsnd: core.c: add WARN_ON() on rsnd_channel_normalization() X-Git-Tag: v5.10.7~3493^2~20^2~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5db8617ba7e8fcda1c5dd310c62ac8d31eaf9eae;p=platform%2Fkernel%2Flinux-rpi.git ASoC: rsnd: core.c: add WARN_ON() on rsnd_channel_normalization() chan > 8 or chan < 0 shouldn't happen. This patch uses WARN_ON() for such case. Reported-by: Pavel Machek Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87y2x530a4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 72924c8..871afe7 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -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 */