Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp992806yba; Thu, 4 Apr 2019 01:58:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXxtnbu95EPN+7zhjHPGOJr6wla1aw8a5bWpg7nTKwZObJUoPT3Dr3Prq8Kd/xs1nSetuW X-Received: by 2002:a65:500d:: with SMTP id f13mr4723140pgo.250.1554368288273; Thu, 04 Apr 2019 01:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368288; cv=none; d=google.com; s=arc-20160816; b=Ym1e4D4Ed/G943RQUxC3CfSBtLfF2gFlKL27QYD0ttLPux7uzpS/2bONLIKlgDsZrA zPNwWvbAdB/ufzdCU2nnqlNbE6F+pXYTaZs5ILjLDdldLiunJc2fmqEMRKVkw7Wm2bNJ kQmGmLLdYk+LgEUWTvzyamS4NlCDQMACOkMOFrwyxMo3IFc/XsHds/2GSKc3+h/UTMiE fZMB6miFXkowCnwKyb0NZkEW3kYDLmOiyVhEGXf3uyjfXdpfwSmH5eBBF0Of24aaPBd+ Fzwut/7dSYz2U30u3PtbciLWw0vUAKzqtk7Zi55YomtsS9pzfxmeM5G0Piqpd3kj/wOM gKgQ== 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=2ZX61X1Q37L7WQl0Mn5X7qTfjy6SzzS8pnzphiXNR/M=; b=Q4J7v0SBsz7k3i6EGx4oHH/J4OtoWsSZpqjnBSasnMhL0eqwfciUnb9nF9BzA0FR+n rqoQuC2NBEkN3QYJ6uGj9us1o/cdUekOpkpHZsm06WUTVONQX0Zbyufdgbdot3SJH5ih 5DlrMKbqrGWZFxcOQ00e4rw2uYJbJ3c8GEP37WK7F9N7HcwL0ueFID2JSTq4DSYnEL0p y8TSLE4612LhXDledmJlcdMF5IrReXq5dmGmMNTS++BYKIGH55ScvyXyH+SXC+wkhrR9 4d0I/KzE6mc1Buj0kimmJZPTTpuKG0RBIr+Md0JWwY6Ahb9u4i6hsef9we8wktvxe9IY +9Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pc4pIn+U; 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 62si15467317pge.445.2019.04.04.01.57.53; Thu, 04 Apr 2019 01:58:08 -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=pc4pIn+U; 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 S1729856AbfDDI4l (ORCPT + 99 others); Thu, 4 Apr 2019 04:56:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:60114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730515AbfDDI4j (ORCPT ); Thu, 4 Apr 2019 04:56:39 -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 691FB21900; Thu, 4 Apr 2019 08:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368198; bh=0MHYsO3JCUy7hTjVLCghAeKMp2/AsKktN63SAFXvits=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pc4pIn+UiAgbOo30nc8yNM6/RN//TvZDYox5GKtsdr2FOfHuP+eiPsN33//BBzDzt usZz8AIBCtty3HoB59aHEKRSXCtcntu5Qipm2IcNYezbvMbLEq6of5YlfxEmU+SU+M Mt87KyKIGB+U+1o3VSuS1lWnZ/NOtWZP+boLhv4o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ranjani Sridharan , Pierre-Louis Bossart , Takashi Iwai , Sasha Levin Subject: [PATCH 4.14 073/121] ALSA: PCM: check if ops are defined before suspending PCM Date: Thu, 4 Apr 2019 10:47:41 +0200 Message-Id: <20190404084549.238420600@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084545.245659903@linuxfoundation.org> References: <20190404084545.245659903@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit d9c0b2afe820fa3b3f8258a659daee2cc71ca3ef ] BE dai links only have internal PCM's and their substream ops may not be set. Suspending these PCM's will result in their ops->trigger() being invoked and cause a kernel oops. So skip suspending PCM's if their ops are NULL. [ NOTE: this change is required now for following the recent PCM core change to get rid of snd_pcm_suspend() call. Since DPCM BE takes the runtime carried from FE while keeping NULL ops, it can hit this bug. See details at: https://github.com/thesofproject/linux/pull/582 -- tiwai ] Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/core/pcm_native.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 1a63d456a3dc..182e4afd21eb 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1482,6 +1482,14 @@ int snd_pcm_suspend_all(struct snd_pcm *pcm) /* FIXME: the open/close code should lock this as well */ if (substream->runtime == NULL) continue; + + /* + * Skip BE dai link PCM's that are internal and may + * not have their substream ops set. + */ + if (!substream->ops) + continue; + err = snd_pcm_suspend(substream); if (err < 0 && err != -EBUSY) return err; -- 2.19.1