Received: by 2002:a25:730a:0:0:0:0:0 with SMTP id o10csp4146096ybc; Fri, 25 Oct 2019 15:29:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw11aYhUZBxommRNJx4vSEcFna1+q9xt1CbwyDQ9/J+dd48Oghsq+6eAcoDSWkVEbXKejGB X-Received: by 2002:a17:906:e82:: with SMTP id p2mr5683005ejf.237.1572042581144; Fri, 25 Oct 2019 15:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572042581; cv=none; d=google.com; s=arc-20160816; b=JA5R7QNmr+FkMUxnop1tX6KtSz3aqSi+LxMcyu0Ug52qLzrONAFKBwTjQrVehjI+FN rRttl9eINChYC6RG4SA4Q2ix4SLpvJORXh/OnoNi1UsCzZtkO+kRokq1DGIuVmBD3kjb VShleUln9IpVc15QVPTqC7YaQ0s+jnHP2KPMJsF0iSvTLUzTEibUW1k2hhpmY09qxyGM Ij6BO06kqCueawogLQlvzcgzlg6uWD9LvwaBQjaa38KKD7fouaV8Rcx8uBtyA1GiewN2 lLsn7BPf6vpTYnuO9NbUgLMjkTfYuEHMmQ+prrLp+3YixR9s+x4bNz1BDAeOLk2ZHyKS AS/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=UIHdbuehA4W5cQC/qzKEDI4VtUGGKof8itjs+eOyx+E=; b=StzNjBDrNRD/I0RhkB6rmsBbvKgyl/dvOMBMcGWgjBs6vJKuXWSH2Ce4e3J86clGpi rzfxTHL8/HygtasJiO0yf2ZlqBX+fnd1fGb49eRwJyWRIgsHFR/V9PXNsAtKRJJQV9gq +UeCq6xoyQ7UBH4xAA5U6fDPLhGyEGdjavP9ZGoPR4nLd9G+j9QHOdGZriKsoU+mGvV2 UDV0uLht+lfrcSA4Y4toxNp7GWHghVROSA6k7Ap21I0IctziaBzVS//i/ZmIwvwW1JJc Rjhm4uRh1otFOzw2v82NlSRNCxrItA3nYU9YiWq0i7Pt4hvSb3+jSJwhKxaY9jpc3DXz ISlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=JF2doRef; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si1806724eda.222.2019.10.25.15.29.17; Fri, 25 Oct 2019 15:29:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=JF2doRef; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409123AbfJYKMY (ORCPT + 99 others); Fri, 25 Oct 2019 06:12:24 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:37732 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409011AbfJYKMX (ORCPT ); Fri, 25 Oct 2019 06:12:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=UIHdbuehA4W5cQC/qzKEDI4VtUGGKof8itjs+eOyx+E=; b=JF2doRefoXnQ lWBOkJj9/uB6Rh/B2njgORKwRLWda76rcCGjW5aM/TE7Pb8uf+ma1bvwawEJiBBbk4x8pN4jUK+7n 05AiVkU+lfk5wAB/2Auucd0ZxvxZUApFlrhkCcfc1x5y7o/iZYpShdZ5K0dZPqiZ132ufI1RuPzZ0 6iw98=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iNwZp-0006eG-Ph; Fri, 25 Oct 2019 10:12:13 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 3AA502743273; Fri, 25 Oct 2019 11:12:13 +0100 (BST) From: Mark Brown To: Colin Ian King Cc: alsa-devel@alsa-project.org, Bard Liao , Ben Zhang , Curtis Malainey , Jaroslav Kysela , kernel-janitors@vger.kernel.org, Liam Girdwood , linux-kernel@vger.kernel.org, Mark Brown , Oder Chiou , Takashi Iwai Subject: Applied "ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp" to the asoc tree In-Reply-To: <20191024124610.18182-1-colin.king@canonical.com> X-Patchwork-Hint: ignore Message-Id: <20191025101213.3AA502743273@ypsilon.sirena.org.uk> Date: Fri, 25 Oct 2019 11:12:13 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5 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 f8a60435703bdde8f8a0ceb1aa8dad59df821583 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 24 Oct 2019 13:46:10 +0100 Subject: [PATCH] ASoC: rt5677: Add missing null check for failed allocation of rt5677_dsp The allocation of rt5677_dsp can potentially fail and return null, so add a null check and return -ENOMEM on a memory allocation failure. Addresses-Coverity: ("Dereference null return") Fixes: a0e0d135427c ("ASoC: rt5677: Add a PCM device for streaming hotword via SPI") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20191024124610.18182-1-colin.king@canonical.com Signed-off-by: Mark Brown --- sound/soc/codecs/rt5677-spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c index 36c02d200cfc..3a17643fcd9f 100644 --- a/sound/soc/codecs/rt5677-spi.c +++ b/sound/soc/codecs/rt5677-spi.c @@ -376,6 +376,8 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component) rt5677_dsp = devm_kzalloc(component->dev, sizeof(*rt5677_dsp), GFP_KERNEL); + if (!rt5677_dsp) + return -ENOMEM; rt5677_dsp->dev = &g_spi->dev; mutex_init(&rt5677_dsp->dma_lock); INIT_DELAYED_WORK(&rt5677_dsp->copy_work, rt5677_spi_copy_work); -- 2.20.1