alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ASoC: Core: check of_property_count_strings failure
@ 2012-04-24  7:24 Richard Zhao
  2012-04-24 11:08 ` Mark Brown
  2012-04-24 16:08 ` Stephen Warren
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Zhao @ 2012-04-24  7:24 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, Richard Zhao, lrg

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-24 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24  7:24 [PATCH 1/1] ASoC: Core: check of_property_count_strings failure Richard Zhao
2012-04-24 11:08 ` Mark Brown
2012-04-24 16:08 ` Stephen Warren

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).