Commit d66e0339 authored by Colin Ian King's avatar Colin Ian King Committed by Mark Brown

ASoC: rsnd: check for zero node count

Most callers of_get_child_count() check that "nr" is non-zero so it
causes a static checker warning when we don't do that here.  This
does not cause a problem or a crash, but having zero SSUIes does not
make sense either so let's add a check.

Addresses-Coverity: ("Unchecked return value")
Fixes: c413983e ("ASoC: rsnd: adjust disabled module")
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210603110315.81146-1-colin.king@canonical.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 14aa731d
...@@ -515,6 +515,9 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv) ...@@ -515,6 +515,9 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv)
else else
nr = priv->ssi_nr; nr = priv->ssi_nr;
if (!nr)
return -EINVAL;
ssiu = devm_kcalloc(dev, nr, sizeof(*ssiu), GFP_KERNEL); ssiu = devm_kcalloc(dev, nr, sizeof(*ssiu), GFP_KERNEL);
if (!ssiu) if (!ssiu)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment