From patchwork Tue Aug 1 14:16:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 109170 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1556373qge; Tue, 1 Aug 2017 07:16:54 -0700 (PDT) X-Received: by 10.28.30.14 with SMTP id e14mr1489780wme.10.1501597014484; Tue, 01 Aug 2017 07:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501597014; cv=none; d=google.com; s=arc-20160816; b=SJE49CjvTgyiKRxPPoAHB7fnwZIzzwNVMdDL3bLlLIm+Y0wAOY6tVT7loYQo/NS3c8 CnEL/O4VhEzIU2sbhWymDXThy/JMOtjO1JNQgYoHEwq2UvdBU+oGy4iYPruQKJ/d1uGA Qz7cnBcFSYOrlj+yyKzVUrMzzA9VjvChlp7TE8mZr4GelLY1ppCgHbqZnYKmPoEmn7hX QLLGHKtpJwH/YXkfC95w++YEso5wzrQDlSw8togS0+85cNDzalqWVftr1qhG39nWSxUd mfvCgCQgHQpD2otN0abGrSP9ifRXqZlTm/ldeLsq8J4qqGZFD5ppkr9vE2mLcdwFdOzz 71VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :delivered-to:arc-authentication-results; bh=Y7EK0whR2Zq2h6xf/F5fgDTf3xDFguSAPT+G3xRf7T8=; b=OER7GMekz5aOZriT3Z3x0LoZOb0KoASXxKjuWXrh00NIKvTo/lvxW66iCZ/arBBiRp 2WSrp33abCFJ8P436b1hDDlIXz+5f/xPz5M+oTBS3y2XB8l/RPuaabggaF1C/Y+P1z6a WXT5poGngmYqZt8kB858zVN2kpBe6oi6U0l0EKlzj/OdyO9qAwtkLdHv3EjhOqM3wMat 56CJLbReVjjCRSLiXlacDUCcSCU6cdA/Ny9dVXWlLFLI2+hA1VNP4ZXEpK1+pXBwRfwr YDIfxn5R1TMXGFQJMDrrppXi+YT8fDKBNw+si6GG0WDFp7iB6MsEA9SzgkqRm96QAnz2 7vIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id y199si1347305wme.208.2017.08.01.07.16.54; Tue, 01 Aug 2017 07:16:54 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A8F46267121; Tue, 1 Aug 2017 16:16:41 +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 3E33F26710B; Tue, 1 Aug 2017 16:16:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id 37D7126691A for ; Tue, 1 Aug 2017 16:16:38 +0200 (CEST) Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dcXyJ-0000aJ-77; Tue, 01 Aug 2017 14:16:33 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dcXyG-0008Kv-NB; Tue, 01 Aug 2017 15:16:28 +0100 From: Mark Brown To: oder_chiou@realtek.com In-Reply-To: <1501480063-32225-1-git-send-email-oder_chiou@realtek.com> Message-Id: Date: Tue, 01 Aug 2017 15:16:28 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: Oder Chiou , jack.yu@realtek.com, alsa-devel@alsa-project.org, hychao@google.com, lgirdwood@gmail.com, broonie@kernel.org, shumingf@realtek.com, bardliao@realtek.com, chinyue@google.com, flove@realtek.com Subject: [alsa-devel] Applied "ASoC: rt5514: Add the sanity checks of the buffer related address" to the asoc tree 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 The patch ASoC: rt5514: Add the sanity checks of the buffer related address has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 818010dac09183e99ff02e35836544b2e1d659f3 Mon Sep 17 00:00:00 2001 From: "oder_chiou@realtek.com" Date: Mon, 31 Jul 2017 13:47:42 +0800 Subject: [PATCH] ASoC: rt5514: Add the sanity checks of the buffer related address The patch add the sanity checks of the buffer related address to make sure the addresses are valid. Signed-off-by: Oder Chiou Signed-off-by: Mark Brown --- sound/soc/codecs/rt5514-spi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.13.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c index 950d1ffdc06c..6f513cc4c56c 100644 --- a/sound/soc/codecs/rt5514-spi.c +++ b/sound/soc/codecs/rt5514-spi.c @@ -173,9 +173,14 @@ static irqreturn_t rt5514_spi_irq(int irq, void *data) rt5514_dsp->buf_rp = buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24; + if (rt5514_dsp->buf_rp % 8) + rt5514_dsp->buf_rp = (rt5514_dsp->buf_rp / 8) * 8; + rt5514_dsp->buf_size = rt5514_dsp->buf_limit - rt5514_dsp->buf_base; - schedule_delayed_work(&rt5514_dsp->copy_work, 0); + if (rt5514_dsp->buf_base && rt5514_dsp->buf_limit && + rt5514_dsp->buf_rp && rt5514_dsp->buf_size) + schedule_delayed_work(&rt5514_dsp->copy_work, 0); return IRQ_HANDLED; }