From: Harry Pan <harry.pan@intel.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: gs0622@gmail.com, Harry Pan <harry.pan@intel.com>,
lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
tiwai@suse.com, alsa-devel@alsa-project.org
Subject: [PATCH] ASoC: dapm: Do not traverse widget hooks to snd-soc-dummy
Date: Wed, 16 Mar 2016 18:43:40 +0800 [thread overview]
Message-ID: <1458125020-13792-1-git-send-email-harry.pan@intel.com> (raw)
All components are initially given an empty card when registering platform,
and since the commit 6e78108bda78
("ASoC: core: Don't probe the component which is dummy")',
snd-soc-dummy will not be probed so that it remains an empty card assigned.
This patch ignores to iterate widget hooks to the 'snd-soc-dummy'
component, else it will trigger memory fault because of invalid dereference
address of card->widgets.
Test by grep -rsI "hello" /sys/devices/platform/skl_nau88l25_ssm4567_i2s/
Conflicts:
sound/soc/soc-dapm.c
Signed-off-by: Harry Pan <harry.pan@intel.com>
---
sound/soc/soc-dapm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 581175a..0bc15c9 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2188,6 +2188,9 @@ static ssize_t dapm_widget_show_component(struct snd_soc_component *cmpnt,
int count = 0;
char *state = "not set";
+ if (!strcmp(cmpnt->name, "snd-soc-dummy"))
+ return 0;
+
list_for_each_entry(w, &cmpnt->card->widgets, list) {
if (w->dapm != dapm)
continue;
--
2.1.2
next reply other threads:[~2016-03-16 13:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 10:43 Harry Pan [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-03-16 11:17 [PATCH] ASoC: dapm: Do not traverse widget hooks to snd-soc-dummy Harry Pan
2016-03-17 9:54 ` Mark Brown
2016-03-17 10:38 ` Pan, Harry
2016-03-17 11:25 ` Mark Brown
2016-03-17 12:37 ` Lars-Peter Clausen
2016-03-17 13:04 ` Pan, Harry
2016-03-17 15:42 ` Mark Brown
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=1458125020-13792-1-git-send-email-harry.pan@intel.com \
--to=harry.pan@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=gs0622@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox