Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp998881yba; Thu, 4 Apr 2019 02:05:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRbXVNyo1O2fxOt9WuougJ4uZP7ruQWJzXolo2j3pJB2/nEcR5mHyQeg8lbb6eN8LfURGQ X-Received: by 2002:a62:565c:: with SMTP id k89mr4544206pfb.175.1554368739685; Thu, 04 Apr 2019 02:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368739; cv=none; d=google.com; s=arc-20160816; b=l6AKGT7zMPxtESV/F0Ob4IPstGr95qbwIRxfiKuaGLXGEtJrybK/xe4SO+UlxMiPWI eC6+sweq/m3HzNUfgi8WLNVSNFKUs6lxiMzD4U1S1EzghN6D8KHnP+S3yHN764OAFf8Y //ekvvdla5hcxLPeDKCBeU7rpqz7QhBH9Ks6D5R6duS4Q7nJ/vm4rYHpbdKkEPk3TnX5 GhasFjVLlRtANcv+TsgJeQImt9NdECbm0Wq9yM/yBzAlKpnB77Fjuw+1q8X/3n0EasAS nihuGIf7oRoUTXeJfzjaYtIN1iFkokZibw51RFpx6zb2YHiYyCBewjFaGTm318l6tWJJ qOvQ== 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=Q0GLd+l1PiPMx1eFZTwrbhmVrIj7nKxdWexOG9hbWWA=; b=isuYwU9eFp6GstX3jVwQri1nhbo0Chm3qGYF4yzgNylfiENI0P6ZZq5ReXxlN7+NDK RGOUsU6TmzyQWW7y5lwWsEOSVheSwiLbpkXMXS0/va3tm/XQZbqb3F+UOzmKMgxs8FJ1 QZQuUbKbPBydbOJrFbwSjRAl5yTx9dQRg8dapbKEVHm6uSavJVrCcxgQiT8xTqNdvrBY 7GzFm0xT37cq1KPcTN71tGDBSwNzz7fwjoG+s2af2GK9x5slySd/qmJtimnBM4pzvfDI +KISXpalvu8JKqXL/HFQEQiZIEOV1fpFJVSRKPDKXgowU3Co9TXUg9fph0NMdPGtnewK WyNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cqWINOb4; 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 m15si16386988pgj.126.2019.04.04.02.05.24; Thu, 04 Apr 2019 02:05:39 -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=cqWINOb4; 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 S1731458AbfDDJEv (ORCPT + 99 others); Thu, 4 Apr 2019 05:04:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:42722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732042AbfDDJEt (ORCPT ); Thu, 4 Apr 2019 05:04:49 -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 C4D642184B; Thu, 4 Apr 2019 09:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368688; bh=gLuRnn5jA9JOPsi1p47Fw0wy4DEAG8+yzzwDjTTjO6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cqWINOb4qYCmICCvshNRb7S8jE53DA3czmEr6QnwF9w/YbglS9izBq93Wd0BgCpUo dtBQTJWZI9cpEPH2PlaaPGO6an3PZtaPEsj/HAQ+FfDCmokW+qbLjbKw3xUVgGjs4g /sQw8NPbIq3ycRUp1ekPZqqG6wrp4KYYwqQPzsQI= 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.19 107/187] ALSA: PCM: check if ops are defined before suspending PCM Date: Thu, 4 Apr 2019 10:47:24 +0200 Message-Id: <20190404084608.295238849@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@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.19-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 b67f6fe08a1b..e08c6c6ca029 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1513,6 +1513,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