Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5614683img; Wed, 27 Mar 2019 11:45:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIlctoPklRQVTVHRFf18YvFN6yPD6R3HiBmB7YLHgGJPv3o4kebB5pj/xKve/L9/cONzBd X-Received: by 2002:a62:168a:: with SMTP id 132mr36395653pfw.155.1553712312751; Wed, 27 Mar 2019 11:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712312; cv=none; d=google.com; s=arc-20160816; b=gvBZj4xsr8GwHRsnjMEYiXJWzmHW2I0VYAEUhmTL/594qbUHG1Pq0JF6/2/qPywLZr nRudm64fXApdps06vlyNsfF4i6/3O2yvoofwiImYwVAwX/7WtoYPgKB3nCGTz1ZWiZsr 2BAymp8IVoXgkYqXf2fd7quYm18xjnn5b8SsuEc7C9ldUyFK4IgDBJoS0mZKJ5781HAy HZmMnJ7cvfEpvosIu/vIRtXQR3Bb46w9QLlgqGDnYS0YnszgBoKstuNm/dinCw9v78NL iEMgts02hF8n2yrxIPy+M0NOSfA9vcyLDwvlTXGLNbiWro5TNHFAH4L+MYZWjEbU5WTm G9gg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DNoPS2RR4ID+Fj33ubFFzAJSbT5qjTyJFKyQ2vVjEtE=; b=sH/t97jaiQfQlH8od0xkHVrsmG+NilYnYoZy9SidK3US5LrctIKCsWvHn3jzirJWF/ j1/gRSCGdKWkouNNyn/0rhHaETiTTV82AeVxlUr8jFDQkkAAMXQpiMRkURtu7lKIcw1s 0XUACKhhYhoIvSJBg5jjvB5eclYm+mMXw1rafhZi4m/bsKcvlcPgrnKAFWHeP38LUcGJ 65ATFqtqpmAz13gOgSQtsIu7d9YUEjEKgMZ9erOpwOiagNbyfd1YMhPXIpQlPHFNOfz9 Z7ZHO7XgffdIjl1xKbSwwzoLeWCaKXclsO3JvAWnZx8qDkFIyCK2+/Vbq9U4NMXIuaTh J8AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cwXxeDB9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l192si19231274pfc.147.2019.03.27.11.44.57; Wed, 27 Mar 2019 11:45:12 -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=cwXxeDB9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391272AbfC0SWO (ORCPT + 99 others); Wed, 27 Mar 2019 14:22:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:40176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391023AbfC0SWK (ORCPT ); Wed, 27 Mar 2019 14:22:10 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91D8320651; Wed, 27 Mar 2019 18:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710930; bh=QVFDIudWL+X+ctM+jjBIbGacnjvdIZPNuX4KiuNA4sM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwXxeDB9i8l1t3pac159skOv3L0nyFkQSsTW6nfd6AwZLTJoL9sIDwtGFtHFEQ72s gjhhgsqmQzAyxxNtsXbC7F3ZIkohsmi/8XnQYvqLUY4xygrskj7w+5Ux7lA1rjn/VD klmUWHPaK0zqE7ofB9js8xPxlSBgzTWBFsLSHrRU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ranjani Sridharan , Pierre-Louis Bossart , Takashi Iwai , Sasha Levin Subject: [PATCH AUTOSEL 4.9 50/87] ALSA: PCM: check if ops are defined before suspending PCM Date: Wed, 27 Mar 2019 14:20:03 -0400 Message-Id: <20190327182040.17444-50-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ranjani Sridharan [ 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 3586ab41dec4..4719f7f42aa8 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1339,6 +1339,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