Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2537802yba; Mon, 6 May 2019 07:41:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx15bBb5kfFJlx4A7GkZ+53yOhtp/RKQBz8XL7kjO8oWW8BFxJ5+9Mvg0dDFnT8VWHBLMSN X-Received: by 2002:a17:902:7d83:: with SMTP id a3mr2886384plm.305.1557153663662; Mon, 06 May 2019 07:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557153663; cv=none; d=google.com; s=arc-20160816; b=xOAUfII1ooLuEg63FN8iGk+pVEYFh4TTj4GXlsTGqa0f2qSl1S/055bx19cI+yRFZ/ br1zQ2tD1F0ilk8SFKqJEwzcpxAW+Kl50kJ7P88V7e6zr3Lwo/HCUFtW099rkWwWiEFZ DHFcwbG7otiSoVHpsLX2mQ/4kqnlu6Af+uUuNHE2lp/tw7Nu2xCfbE036bY0ozeshBHi L2Av1BO7QJr1LjUYb0rd78LsI5tC+c6YDZt9LcdCRH8SN4aU/kPEji1oaTCvVNfPuRfP edOpUuVI9BDdD9u6DQpH8z5vOevmLUvx/83l2KO5QKWcynG/NX0b+5eTOyr88714Q3fO Rt9w== 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 h18si14508996pgg.265.2019.05.06.07.40.45; Mon, 06 May 2019 07:41:03 -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 S1727468AbfEFOhq (ORCPT + 99 others); Mon, 6 May 2019 10:37:46 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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;