From: Richard Zhao <richard.zhao@freescale.com>
To: alsa-devel@alsa-project.org
Cc: broonie@opensource.wolfsonmicro.com,
Richard Zhao <richard.zhao@freescale.com>,
lrg@ti.com
Subject: [PATCH 1/1] ASoC: Core: check of_property_count_strings failure
Date: Tue, 24 Apr 2012 15:24:43 +0800 [thread overview]
Message-ID: <1335252283-27750-1-git-send-email-richard.zhao@freescale.com> (raw)
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
---
sound/soc/soc-core.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 20e55531..ce4d462 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3683,10 +3683,10 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
int i, ret;
num_routes = of_property_count_strings(np, propname);
- if (num_routes & 1) {
+ if (num_routes < 0 || num_routes & 1) {
dev_err(card->dev,
- "Property '%s's length is not even\n",
- propname);
+ "Property '%s' does not exist or its length is not even\n",
+ propname);
return -EINVAL;
}
num_routes /= 2;
--
1.7.5.4
next reply other threads:[~2012-04-24 7:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-24 7:24 Richard Zhao [this message]
2012-04-24 11:08 ` [PATCH 1/1] ASoC: Core: check of_property_count_strings failure Mark Brown
2012-04-24 16:08 ` Stephen Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335252283-27750-1-git-send-email-richard.zhao@freescale.com \
--to=richard.zhao@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).