From patchwork Mon Sep 10 17:53:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 146346 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2765431ljw; Mon, 10 Sep 2018 10:54:09 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbp+1dBVmdeBL3+KrL+FJCRAibYQcjZ9rVX826L3nx7QgUAdhltC64sf6+VNZhy3yJUoLTV X-Received: by 2002:adf:dbc3:: with SMTP id e3-v6mr15055105wrj.217.1536602049075; Mon, 10 Sep 2018 10:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536602049; cv=none; d=google.com; s=arc-20160816; b=aG9j8zlSj2We3AgqB/BJQ2MciNuaDTscIFgEeSbOLR+HzSylQheW+Rbv/WCdof40Ph rt6KvNbjeNbqdda9VAD3RluZrVxpey4jSd8pcqlmGuUna+npuUXNmHLID5daOnUb9MQm CKbxTPrJxgZj0XjBTX/DEvScHLoe4YqjdoLvAgA0jZJfykSmGQgaRuhxtJDJ67dKh2DA oYu5mRWvX2MLr2oAVL76cw/VhM9P/weUJygqMPDdKnaP0I070Pz58nROMWTGYERp91fO SNn7eHlUsSH7ypKA3DBfJwB1um3mNXtx2J1wQK1VzRHSTo9+nYXh8eQShV2iV9/LkFR0 sNZg== 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 :dkim-signature:delivered-to; bh=Kgb1jWvYOyYSxdqnPmo8w/8Bp7756DGHEam/+hM7fdM=; b=EstKeAX3u2UibPJgDolRDdr99zp3+wQKlcU//7j/pNhG94q1q8Eek2W5MDtwE55uZ5 WSuVsfaACJu4kYigk5B1GbVgdujlIH/iJJNzjcOwIAYY7suIkOi0PWcq8U9beTM4sQAG nXBPuQ6GxnczBICZEVvNgKpuT7O8G37NS8HaSuxMLJOHFtEOXVkEyLTGlrIPQDN7JWn3 nU9zbOWidFoIIsuHpr8bSTYGjwWZgFyKEicDuGvR8cpMVaT74E33uhiWJKHHcCIZ8n8B QDstaFACyq/jjsW44nyfXpfQNymPdQJn6BspdAIZ1Z+dIZzSBbVcpNFkhX1U1RLVE0h5 RtVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=F9aKiVWj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id x68-v6si460795wmf.140.2018.09.10.10.54.08; Mon, 10 Sep 2018 10:54:09 -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; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=F9aKiVWj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AF5032678A9; Mon, 10 Sep 2018 19:54:07 +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 6BB922678A7; Mon, 10 Sep 2018 19:54:05 +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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 2A1CB2678A6 for ; Mon, 10 Sep 2018 19:54:02 +0200 (CEST) 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=Q+JweWG6vHRcK4vytPrJ4x/zM4VLrzVd7iX/yVQGQ8c=; b=F9aKiVWj4LLH GMwgQ5hz33nBC6tc0bXkmrsLr7geoDJG9PnZivfS+RiZzGZfx02qOuycHfPL5AUrciSEoJBoZBi8+ YV6/uDBzEX4AenTnBD0HQRX29e1171Mflf/HJ8QNdgvVKm5pFLaMG1mAwxyv6OMwj02NevR5uPlJy cOMCY=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1fzQNp-00028V-Bo; Mon, 10 Sep 2018 17:53:57 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 12A8E11227B6; Mon, 10 Sep 2018 18:53:57 +0100 (BST) From: Mark Brown To: Charles Keepax In-Reply-To: <20180910142839.12051-1-ckeepax@opensource.cirrus.com> Message-Id: <20180910175357.12A8E11227B6@debutante.sirena.org.uk> Date: Mon, 10 Sep 2018 18:53:57 +0100 (BST) Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com, dan.carpenter@oracle.com Subject: [alsa-devel] Applied "ASoC: dapm: Add missing return value check for snd_soc_dapm_new_dai" 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: dapm: Add missing return value check for snd_soc_dapm_new_dai has been applied to the asoc tree at https://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 e36a1d0d249aa09f94d551cadf043a7f9f7fae00 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Mon, 10 Sep 2018 15:28:39 +0100 Subject: [PATCH] ASoC: dapm: Add missing return value check for snd_soc_dapm_new_dai snd_soc_dapm_new_dai may return an error pointer and currently this isn't checked for in dapm_connect_dai_link_widgets. Add code to check the return value and not add routes in that case. Fixes: 778ff5bb8689 ("ASoC: dapm: Move connection of CODEC to CODEC DAIs") Reported-by: Dan Carpenter Signed-off-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/soc-dapm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.19.0.rc1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 0dcdcc23dcfd..43983c69f6aa 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -4087,6 +4087,13 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card, playback = snd_soc_dapm_new_dai(card, rtd, playback_cpu, codec); + if (IS_ERR(playback)) { + dev_err(rtd->dev, + "ASoC: Failed to create DAI %s: %ld\n", + codec_dai->name, + PTR_ERR(playback)); + continue; + } snd_soc_dapm_add_path(&card->dapm, playback_cpu, playback, NULL, NULL); @@ -4099,7 +4106,9 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card, snd_soc_dapm_add_path(&card->dapm, playback, codec, NULL, NULL); } + } + for_each_rtd_codec_dai(rtd, i, codec_dai) { /* connect BE DAI capture if widgets are valid */ codec = codec_dai->capture_widget; @@ -4108,6 +4117,13 @@ static void dapm_connect_dai_link_widgets(struct snd_soc_card *card, capture = snd_soc_dapm_new_dai(card, rtd, codec, capture_cpu); + if (IS_ERR(capture)) { + dev_err(rtd->dev, + "ASoC: Failed to create DAI %s: %ld\n", + codec_dai->name, + PTR_ERR(capture)); + continue; + } snd_soc_dapm_add_path(&card->dapm, capture, capture_cpu, NULL, NULL);