From patchwork Mon Jun 2 14:25:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 4282611 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04756BEEA7 for ; Mon, 2 Jun 2014 14:26:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32A502024D for ; Mon, 2 Jun 2014 14:26:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EDFD620127 for ; Mon, 2 Jun 2014 14:26:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id ED7842652E7; Mon, 2 Jun 2014 16:26:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 238F5265530; Mon, 2 Jun 2014 16:26:10 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2B505265543; Mon, 2 Jun 2014 16:26:09 +0200 (CEST) Received: from na01-bn1-obe.outbound.protection.outlook.com (dns-bn1lp0143.outbound.protection.outlook.com [207.46.163.143]) by alsa0.perex.cz (Postfix) with ESMTP id D366D2652E7 for ; Mon, 2 Jun 2014 16:26:00 +0200 (CEST) Received: from DM2PR03CA008.namprd03.prod.outlook.com (10.141.52.156) by BL2PR03MB500.namprd03.prod.outlook.com (10.141.93.152) with Microsoft SMTP Server (TLS) id 15.0.949.11; Mon, 2 Jun 2014 14:25:58 +0000 Received: from BY2FFO11FD028.protection.gbl (2a01:111:f400:7c0c::155) by DM2PR03CA008.outlook.office365.com (2a01:111:e400:2414::28) with Microsoft SMTP Server (TLS) id 15.0.949.11 via Frontend Transport; Mon, 2 Jun 2014 14:25:57 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD028.mail.protection.outlook.com (10.1.15.217) with Microsoft SMTP Server (TLS) id 15.0.949.9 via Frontend Transport; Mon, 2 Jun 2014 14:25:57 +0000 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.244.88]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s52EPrTD013288; Mon, 2 Jun 2014 07:25:55 -0700 From: Fabio Estevam To: Date: Mon, 2 Jun 2014 11:25:46 -0300 Message-ID: <1401719146-17252-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.8.3.2 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(84676001)(33646001)(46102001)(87936001)(92566001)(68736004)(77156001)(50466002)(6806004)(99396002)(89996001)(77982001)(79102001)(62966002)(83072002)(47776003)(69596002)(19580405001)(64706001)(104166001)(76482001)(77096999)(93916002)(104016001)(44976005)(19580395003)(85852003)(4396001)(74502001)(86362001)(50226001)(50986999)(36756003)(81542001)(21056001)(80022001)(102836001)(92726001)(81342001)(20776003)(97736001)(81156002)(83322001)(74662001)(48376002)(88136002)(26826002)(31966008)(87286001); DIR:OUT; SFP:; SCL:1; SRVR:BL2PR03MB500; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 0230B09AC4 Received-SPF: Fail (: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Fabio.Estevam@freescale.com; X-OriginatorOrg: freescale.com Cc: Fabio Estevam , alsa-devel@alsa-project.org, lars@metafoo.de, lgirdwood@gmail.com, Li.Xiubo@freescale.com, jarkko.nikula@linux.intel.com Subject: [alsa-devel] [PATCH v2] ASoC: soc-cache: Fix the return value of snd_soc_cache_init when reg_size is 0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Commit b59dce53ef6 (ASoC: cache: Fix possible ZERO_SIZE_PTR pointer dereferencing error.) caused the following probe error: wm8962 0-001a: customer id 0 revision D wm8962 0-001a: ASoC: Failed to set cache compression type: -22 imx-wm8962 sound: snd_soc_register_card failed (-22) imx-wm8962: probe of sound failed with error -22 If reg_size is 0 just return success instead. Suggested-by: Lars-Peter Clausen Signed-off-by: Fabio Estevam --- Changes since v1: - Fix typo "If reg_size is 0 just return success instead." sound/soc/soc-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 8fff5b6..00e70b6 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c @@ -73,7 +73,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec) reg_size = codec_drv->reg_cache_size * codec_drv->reg_word_size; if (!reg_size) - return -EINVAL; + return 0; mutex_init(&codec->cache_rw_mutex);