From: Kuninori Morimoto Date: Tue, 10 Dec 2019 00:34:48 +0000 (+0900) Subject: ASoC: soc-core: soc_set_name_prefix(): tidyup loop condition X-Git-Tag: v5.15~2585^2~265^2~270 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4702f99148dae94b00bcb7bbba6cd9ca01651e69;p=platform%2Fkernel%2Flinux-starfive.git ASoC: soc-core: soc_set_name_prefix(): tidyup loop condition Current soc_set_name_prefix() for loop is checking both codec_conf pointer and its number for (...; i < card->num_configs && card->codec_conf; ...) But, if card->num_configs exists but card->codec_conf was NULL, it is just bug. This patch cleanups for loop condition. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/87wob5xbkn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d18e30e..a483f6f 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1211,7 +1211,7 @@ static void soc_set_name_prefix(struct snd_soc_card *card, { int i; - for (i = 0; i < card->num_configs && card->codec_conf; i++) { + for (i = 0; i < card->num_configs; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i]; struct device_node *of_node = soc_component_to_node(component);