From patchwork Tue Apr 24 07:24:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 8064 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C8A2C23E4C for ; Tue, 24 Apr 2012 07:25:01 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7BD31A1857B for ; Tue, 24 Apr 2012 07:25:01 +0000 (UTC) Received: by iage36 with SMTP id e36so889628iag.11 for ; Tue, 24 Apr 2012 00:25:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :x-spamscore:x-bigfish:x-forefront-antispam-report:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-originatororg:x-gm-message-state; bh=aVUDv0SURf7CwGyAro22oKjGnf1+fQZjskzCH5bFBxI=; b=UUN6EMAM8mkNXttbd28at+GF/z1uiPqvMVJCT9iWu5Rbh3krML/JHbXx7b21QXqHOq W5C3Pfy+zq2i0sWr5wrGHvNKB9MLE5g46N1VETGjKE39sPoHMeWTZQoxllZHy78i6J70 4s+A2fc+Q2Qo4NLN8WMY6eruwk5VwSAv9cWKJ5Z/mJ4pukPuunTIglRyLO17eaWVkM8V iQveUlwQD9Wg34ArJngceYPOqTd5q6bMZSk9eyDEZVpgwXaz6bTb8Z4/m4nuVfcJX6MX sRVC16WdkQTjVDKs8SulUUHIdNtKHxoSFJtwqyJyYIlP992GRNSLAzPiFH6SWfv4b/7y iDXA== Received: by 10.50.193.199 with SMTP id hq7mr8633396igc.49.1335252300640; Tue, 24 Apr 2012 00:25:00 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp162774ibt; Tue, 24 Apr 2012 00:24:59 -0700 (PDT) Received: by 10.180.95.129 with SMTP id dk1mr32602564wib.3.1335252298862; Tue, 24 Apr 2012 00:24:58 -0700 (PDT) Received: from db3outboundpool.messaging.microsoft.com (db3ehsobe004.messaging.microsoft.com. [213.199.154.142]) by mx.google.com with ESMTPS id m8si3782782wee.82.2012.04.24.00.24.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 00:24:58 -0700 (PDT) Received-SPF: neutral (google.com: 213.199.154.142 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) client-ip=213.199.154.142; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.142 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) smtp.mail=B20223@freescale.com Received: from mail50-db3-R.bigfish.com (10.3.81.225) by DB3EHSOBE002.bigfish.com (10.3.84.22) with Microsoft SMTP Server id 14.1.225.23; Tue, 24 Apr 2012 07:24:57 +0000 Received: from mail50-db3 (localhost [127.0.0.1]) by mail50-db3-R.bigfish.com (Postfix) with ESMTP id 7813A3400BE; Tue, 24 Apr 2012 07:24:57 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bh) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail50-db3 (localhost.localdomain [127.0.0.1]) by mail50-db3 (MessageSwitch) id 1335252295595732_18648; Tue, 24 Apr 2012 07:24:55 +0000 (UTC) Received: from DB3EHSMHS002.bigfish.com (unknown [10.3.81.242]) by mail50-db3.bigfish.com (Postfix) with ESMTP id 834F0480104; Tue, 24 Apr 2012 07:24:55 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS002.bigfish.com (10.3.87.102) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 24 Apr 2012 07:24:55 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.355.3; Tue, 24 Apr 2012 02:24:54 -0500 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q3O7OpM1006170; Tue, 24 Apr 2012 02:24:52 -0500 (CDT) From: Richard Zhao To: CC: , , Richard Zhao Subject: [PATCH 1/1] ASoC: Core: check of_property_count_strings failure Date: Tue, 24 Apr 2012 15:24:43 +0800 Message-ID: <1335252283-27750-1-git-send-email-richard.zhao@freescale.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Gm-Message-State: ALoCoQm/0Ln0stKcDjoM/FibmCXozPoAHWpyoX9nNUnJUE4Jz2gOylFdriV4Pyt8rQr7OfQNRjZx Signed-off-by: Richard Zhao --- 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;