From patchwork Mon Jun 18 12:00:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 138918 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3869728lji; Mon, 18 Jun 2018 05:04:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJngiGResGn6CZxbUIExlZp16uzjUpPiFpnW7+PhxkO77ltajx4yamDm8m/dBN+qK4dxsFe X-Received: by 2002:a1c:d483:: with SMTP id l125-v6mr7817969wmg.98.1529323470131; Mon, 18 Jun 2018 05:04:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529323470; cv=none; d=google.com; s=arc-20160816; b=K5keL9M27JyIChe841xrrHSwQw7dPsRyy7fJVA0rKPqBfwDyI4m57Y4XVIg1m0Yl4P VmsizKNJDg245yaduSQFJsoLGhIvVwFjUD4OSshqotbB5Crd3ZLkAu1o8hlKrAo0Yj/2 98Nep28VbwlYvWoe8+HR5jpc8ixYW5JC+EG46Y4rQPtPA5ZpEzqST8jHwzluINZUWYmf yR+wFPZlmzTA1+QfPAJ0gL9RDLJ0BvBmwrs6ooQuklxOx8Qp+VNXutbogp1Wg/3A49C0 DjufjesDMNvn3A/HVF6nbqCOgS06bG2O8hT00U5P3kKtG63A6uP355aqNx9LvjihSrh3 7jrQ== 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:arc-authentication-results; bh=45lxtdV0r1I/sNedD2lIAF3Uk1fzbra9zfpDJsgbHHA=; b=XmCf4H8gFKjmesLU+0AwZOOEgPA5nW+X2vowweTV+hv2/pjkLM4Dtd1Q/4rjCS42bz 4Vc7kKvVrSmSYgXOMjzE1V+PBhTdu5s8SaZpGcFH5IVP4bIQeMjkSkYmRYCQHQhH00pE xV6uXvgBI55LNT4o/zwSvtA1CCFshqhoD2vPLeEITMAlNDjtER0wP/1KP+gSlFpvp9Th cVaWftM3O7RdHd3bE9FOiWzZtCEdGAIoeTkpjyA6t584YfIOKpKB8Y8MyVVVHa7OTjat s/3+fP0w+c8sBeSGLg8UuRmlC5+JaVX2C+HPl2rzzJqVmPackh1JcPuP0HXIt0o93HtQ ALXA== 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=jC286xUD; 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 b5-v6si4023863wrj.187.2018.06.18.05.04.29; Mon, 18 Jun 2018 05:04:30 -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=jC286xUD; 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 F0DE526778C; Mon, 18 Jun 2018 14:01:15 +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 62EE126774B; Mon, 18 Jun 2018 14:01:13 +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 DD04B2677A2 for ; Mon, 18 Jun 2018 14:00:56 +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=61bS6OYHB8bx9y5/C1a5/nJggec3Skr0oBUFLF8xgPE=; b=jC286xUDivE1 j0XE+N/PTIf6ElqCSxzqx4G71k6G3tXRr/M2nmCE6PgTD5QgN6mUzFzfPbN+ipapxzHhpmWqyPloa yFnQ2ctxaAFdvStGs1ybSMhMPHzviTJDTBCIiFhIcRYo//QR50geclsZxvvXfp8mxd6lJ/TAPaWjk Bpc94=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fUsq7-00080o-1s; Mon, 18 Jun 2018 12:00:55 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fUsq6-0000Tp-L9; Mon, 18 Jun 2018 13:00:54 +0100 From: Mark Brown To: Liam Girdwood In-Reply-To: <20180614192642.11708-1-liam.r.girdwood@linux.intel.com> Message-Id: Date: Mon, 18 Jun 2018 13:00:54 +0100 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: dapm: Fix potential DAI widget pointer deref when linking DAIs" 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: Fix potential DAI widget pointer deref when linking DAIs 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 e01b4f624278d5efe5fb5da585ca371947b16680 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 14 Jun 2018 20:26:42 +0100 Subject: [PATCH] ASoC: dapm: Fix potential DAI widget pointer deref when linking DAIs Sometime a component or topology may configure a DAI widget with no private data leading to a dev_dbg() dereferencne of this data. Fix this to check for non NULL private data and let users know if widget is missing DAI. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/soc-dapm.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.17.1 _______________________________________________ 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 36a39ba30226..8ede773b1db8 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -4073,6 +4073,13 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card) continue; } + /* let users know there is no DAI to link */ + if (!dai_w->priv) { + dev_dbg(card->dev, "dai widget %s has no DAI\n", + dai_w->name); + continue; + } + dai = dai_w->priv; /* ...find all widgets with the same stream and link them */