From patchwork Mon May 6 14:32:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 163408 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp52976ilm; Mon, 6 May 2019 07:37:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyroaKXlCG/IduleoFr0FtGpU6mrTGlV+We9bx4awcbGSUkn46i1KTTMoi+dUve765Mn/7s X-Received: by 2002:a62:1990:: with SMTP id 138mr33015094pfz.98.1557153468002; Mon, 06 May 2019 07:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557153467; cv=none; d=google.com; s=arc-20160816; b=Uxjf04bMVCEoEnxp2CPSfqo0zX07IHcNJSuOH/9gcX1+8a884n52gKsiEddFfbusRF 0UHKi12PJBidCmricFEwUH21xLZ4gVXqXddQiv2Y/Etj5MCWfwBiGnmzM2TnTWiGtc+G X/9si3WEINYKxypeDy7BXpwdUywRDkVQBQbuqMpOqo+JfIP+0fITGe66vD8SyqrPsSwI 8yk4v3QRFspD/ZhuJBH12eS7kefSFQrgyw4x7OEH8tnlp0libTOaXr6fm0CQMT3rkI0f myEoW6g9Y36W1YngQcEmYV+TJvcVDJXfteXrD9Uqz8aBvx2CKl5hJj9LnxkJufZnV0ZP PcBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HIzZ5Y8UmmdmWlMc3rcYIY8AyByQ+xEvm0ODctiHNCk=; b=dPW2LFwCWS9a5DeKmJDRi9nGddzKz7tEKOMLZ++KkDwYGQChqjGY8C7kF/ukdRTSOi MNcu0ImbCyiLVoXamMVoRvksphT7eY9/gLnzquWvczlsnBXNUduq5Ve42Y/1tcxEI6SM HLZYsGevf7YKv2qO5gkfgRDsMmEg+HE3d4PUVHHZV5REjwNwow0e8+x1PX4Z0Ovm3JCW 0Ynar+eQHsgklHoi7tF8GvVUEnXuYkPiQC86mmciDliu0otk2HL84qq/WmHjn4j0K3GP mNT/upJrtxly7BYMXp9iPs6dcmXV+lk/3YLbR9Lw2JCY2CI4HjKjA3XZUBb5Yn17kjsx 3V3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qPCWpawv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si14298394pgh.448.2019.05.06.07.37.47; Mon, 06 May 2019 07:37:47 -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=pass header.i=@kernel.org header.s=default header.b=qPCWpawv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727469AbfEFOhr (ORCPT + 30 others); Mon, 6 May 2019 10:37:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:58564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727447AbfEFOho (ORCPT ); Mon, 6 May 2019 10:37:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DB18204EC; Mon, 6 May 2019 14:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153463; bh=VlWkBUEImB78/og5ALQ2v1xG5jr0UAHU6iU6re1Vq5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qPCWpawv6Xf7EZAger1HMUauaIj2knqUtI/fLd/2VpGmIZP1iD/qkOrRDP6FwiQG1 f9/uPLZFQTinQfjk5oPpLOOwsKZdXmxT9HOd5cmm2o7/aVKBHoUj1ilv+kEqz95CO9 k8zXNrldZzsaYl6RFQz0WDPXQsSTECguUDXWhmBQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jerome Brunet , Mark Brown Subject: [PATCH 5.0 098/122] ASoC: dpcm: skip missing substream while applying symmetry Date: Mon, 6 May 2019 16:32:36 +0200 Message-Id: <20190506143103.555118908@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jerome Brunet commit 6246f283d5e02ac757bd8d9bacde8fdc54c4582d upstream. If for any reason, the backend does not have the requested substream (like capture on a playback only backend), the BE will be skipped in dpcm_be_dai_startup(). However, dpcm_apply_symmetry() does not skip those BE and will dereference the be_substream (NULL) pointer anyway. Like in dpcm_be_dai_startup(), just skip those BE. Fixes: 906c7d690c3b ("ASoC: dpcm: Apply symmetry for DPCM") Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-pcm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1895,10 +1895,15 @@ static int dpcm_apply_symmetry(struct sn struct snd_soc_pcm_runtime *be = dpcm->be; struct snd_pcm_substream *be_substream = snd_soc_dpcm_get_substream(be, stream); - struct snd_soc_pcm_runtime *rtd = be_substream->private_data; + struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai *codec_dai; int i; + /* A backend may not have the requested substream */ + if (!be_substream) + continue; + + rtd = be_substream->private_data; if (rtd->dai_link->be_hw_params_fixup) continue;