[alsa-devel] [PATCH 1/1] ASoC: Core: check of_property_count_strings failure
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;
On Tue, Apr 24, 2012 at 03:24:43PM +0800, Richard Zhao wrote:
Signed-off-by: Richard Zhao richard.zhao@freescale.com
Applied, thanks (and sent to stable too).
On 04/24/2012 01:24 AM, Richard Zhao wrote:
Signed-off-by: Richard Zhao richard.zhao@freescale.com
Acked-by: Stephen Warren swarren@wwwdotorg.org
participants (3)
-
Mark Brown
-
Richard Zhao
-
Stephen Warren