diff options
author | Subhransu S. Prusty <subhransu.s.prusty@intel.com> | 2015-12-09 21:46:08 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-01-05 19:18:34 +0000 |
commit | 541140d43046ccd4e7b511846d22b3d3ca7367f3 (patch) | |
tree | aaa18d4c91af3023146db6c8b8cb7961675b38c7 /sound/soc/codecs/hdac_hdmi.c | |
parent | ee1e4e3f0d50aebdc6dac2a2cd4ae203ed2a75c1 (diff) | |
download | linux-stable-541140d43046ccd4e7b511846d22b3d3ca7367f3.tar.gz linux-stable-541140d43046ccd4e7b511846d22b3d3ca7367f3.tar.bz2 linux-stable-541140d43046ccd4e7b511846d22b3d3ca7367f3.zip |
ASoC: hdac_hdmi: Fix to check num nodes correctly
commit 3c83ac23253c ("ASoC: hdac_hdmi: check error return") fixes
the static checker warning reported by Dan Carpenter:
sound/soc/codecs/hdac_hdmi.c:416 hdac_hdmi_parse_and_map_nid()
warn: unsigned 'hdac->num_nodes' is never less than zero.
But it doesn't fix the issue completely.
It's also a failure if no sub nodes found for an afg node. So modify
the return condition appropriately.
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/hdac_hdmi.c')
-rw-r--r-- | sound/soc/codecs/hdac_hdmi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index b999fb2a463b..e6dc4cd037d3 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -415,7 +415,7 @@ static int hdac_hdmi_parse_and_map_nid(struct hdac_ext_device *edev) int cvt_nid = 0, pin_nid = 0; num_nodes = snd_hdac_get_sub_nodes(hdac, hdac->afg, &nid); - if (!nid || num_nodes < 0) { + if (!nid || num_nodes <= 0) { dev_warn(&hdac->dev, "HDMI: failed to get afg sub nodes\n"); return -EINVAL; } |