All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Stephen Warren <swarren@nvidia.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@ti.com>,
	"[v3.1]"@mail.zonque.de, Daniel Mack <zonque@gmail.com>,
	stable@kernel.org
Subject: [PATCH] ASoC: core: don't try to resume uninstantiated a soc-audio devices
Date: Wed, 23 Nov 2011 20:24:10 +0100	[thread overview]
Message-ID: <1322076250-22203-1-git-send-email-zonque@gmail.com> (raw)

The code tries to schedule a work item from the resume context, which
will crash the kernel if snd_soc_instantiate_card() has not been called
for the card before.

The bug I triggered is related to 82e14e8b ("ASoC: core: Don't schedule
deferred_resume_work twice"), hence a backport to 3.1 is necessary.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: stable@kernel.org [v3.1]
---
 sound/soc/soc-core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a5d3685..721f16e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -709,6 +709,9 @@ int snd_soc_resume(struct device *dev)
 	struct snd_soc_card *card = dev_get_drvdata(dev);
 	int i, ac97_control = 0;
 
+	if (!card->instantiated)
+		return 0;
+
 	/* AC97 devices might have other drivers hanging off them so
 	 * need to resume immediately.  Other drivers don't have that
 	 * problem and may take a substantial amount of time to resume
-- 
1.7.7.3

             reply	other threads:[~2011-11-23 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 19:24 Daniel Mack [this message]
2011-11-23 21:26 ` [PATCH] ASoC: core: don't try to resume uninstantiated a soc-audio devices Mark Brown
2011-11-23 21:37   ` Daniel Mack
2011-11-23 21:51     ` Mark Brown
2011-11-23 22:39       ` Daniel Mack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322076250-22203-1-git-send-email-zonque@gmail.com \
    --to=zonque@gmail.com \
    --cc="[v3.1]"@mail.zonque.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@ti.com \
    --cc=stable@kernel.org \
    --cc=swarren@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.