diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-12-01 14:29:35 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-12-01 18:44:26 +0000 |
commit | 3c83ac23253c6a1b6d3ebcb4bb05eabb8337c9df (patch) | |
tree | 22ca9b118574992dcf15582794891635e0623268 | |
parent | 65976878ca692566ed066f4fa977de517f697c59 (diff) |
ASoC: hdac_hdmi: check error return
As hdac->num_nodes is unsigned we can not check if
snd_hdac_get_sub_nodes() has returned error or success. Lets have a
temporary int to check the error value.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/hdac_hdmi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 205f2c27263d..1a2f33b4abfc 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -409,17 +409,18 @@ static int hdac_hdmi_init_dai_map(struct hdac_ext_device *edev, static int hdac_hdmi_parse_and_map_nid(struct hdac_ext_device *edev) { hda_nid_t nid; - int i; + int i, num_nodes; struct hdac_device *hdac = &edev->hdac; struct hdac_hdmi_priv *hdmi = edev->private_data; int cvt_nid = 0, pin_nid = 0; - hdac->num_nodes = snd_hdac_get_sub_nodes(hdac, hdac->afg, &nid); - if (!nid || hdac->num_nodes < 0) { + num_nodes = snd_hdac_get_sub_nodes(hdac, hdac->afg, &nid); + if (!nid || num_nodes < 0) { dev_warn(&hdac->dev, "HDMI: failed to get afg sub nodes\n"); return -EINVAL; } + hdac->num_nodes = num_nodes; hdac->start_nid = nid; for (i = 0; i < hdac->num_nodes; i++, nid++) { |