From patchwork Fri Jun 9 07:01:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9777391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09EA060393 for ; Fri, 9 Jun 2017 07:01:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8248285FB for ; Fri, 9 Jun 2017 07:01:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAAE328607; Fri, 9 Jun 2017 07:01:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C9B6285E1 for ; Fri, 9 Jun 2017 07:01:41 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1F871267557; Fri, 9 Jun 2017 09:01:40 +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 D8D34267558; Fri, 9 Jun 2017 09:01:38 +0200 (CEST) Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by alsa0.perex.cz (Postfix) with ESMTP id D98CD266CB8 for ; Fri, 9 Jun 2017 09:01:34 +0200 (CEST) Received: by mail-pg0-f65.google.com with SMTP id v14so6884063pgn.1 for ; Fri, 09 Jun 2017 00:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=DZWb1KpEdhX4n4Wor2UZ0SDd/pTjkUYUNyz2xQWKLX8=; b=bLz4CN81AST61+DAyJKzSG64F0WRLQN47DvCQ14sf/MX1UMOW4jAy84c3z0NWQcU0R Ho4Hu5S0Ysu6W5+H3eIjNt2bSCte4wWU5ggCxa0uWrhYmvshEteEBPsPgwpJIaCJNjK8 ggrXCrNWgcuiACQ9ic2X8sOfsrqbo2h0zmC91Xx3s2SWxGE8MH11PeZd1zEttwPszyXg 7lObWUZ3Vj1/vXneSkEgzGTH//mfsPI0BFZAV2ZRXxDsX3RZxnEo4BeHsLlaq3tlfctQ jBhH+yeXT/Ib4QCMgYoeCCE6i3LuW3PCHwhEXDlh8gfxzyGhbMXTHvRL2/iGN/yQ/o2J e4Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DZWb1KpEdhX4n4Wor2UZ0SDd/pTjkUYUNyz2xQWKLX8=; b=hP5UdzWxcR11l4igY91yHsJX5Q0bli5tfU+K+HSxoquh2zrAZ1PzKxKlICu1WGumel SzqRoDkBI/W60+5BdamYiwfvEpThH99JaMloh14Ji3BfrJiSeQNMgpQDuMeRf3M9BxjF imfSzNyT/OksN827fgpdmSsk05577eDaO7vHnTkfvO2J02+ahYhPHwOZyDENgqjlPH1r 4hw2DEUW9pIDDcIT7tOHIY5BIrhHOUcf+3+i7kQZhuiZIFSRBS07xSGAQQHbQq+4W/5j RQdyXpf8Wq/8a/iL6NrTysmMJYi0BUD3nhk7akTykKewYBHP3lO19m9068kRxPHhHgCW CbZQ== X-Gm-Message-State: AODbwcDaW89GEBCZrQTmXj/Kp+ZWZU+7mB2THI3wNYCSFx2KgzpnwOX7 GJugS0xRPe8Arudn X-Received: by 10.99.119.132 with SMTP id s126mr30328366pgc.52.1496991693396; Fri, 09 Jun 2017 00:01:33 -0700 (PDT) Received: from localhost.localdomain (218-164-25-49.dynamic-ip.hinet.net. [218.164.25.49]) by smtp.gmail.com with ESMTPSA id x5sm1006468pfi.103.2017.06.09.00.01.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 00:01:32 -0700 (PDT) From: Axel Lin To: Mark Brown Date: Fri, 9 Jun 2017 15:01:21 +0800 Message-Id: <20170609070121.30359-1-axel.lin@ingics.com> X-Mailer: git-send-email 2.9.3 Cc: alsa-devel@alsa-project.org, Axel Lin , Ryo Kodama , Kuninori Morimoto , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: ak4613: Fix out of bounds array access for ak4613_iface 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Axel Lin Acked-by: Kuninori Morimoto --- sound/soc/codecs/ak4613.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index e3121ca..c87ec49 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -347,7 +347,7 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, if (ak4613_dai_fmt_matching(priv->iface, is_play, fmt, width)) iface = priv->iface; } else { - for (i = ARRAY_SIZE(ak4613_iface); i >= 0; i--) { + for (i = ARRAY_SIZE(ak4613_iface) - 1; i >= 0; i--) { if (!ak4613_dai_fmt_matching(ak4613_iface + i, is_play, fmt, width))