From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755357AbcCPNIP (ORCPT ); Wed, 16 Mar 2016 09:08:15 -0400 Received: from 123-192-253-61.dynamic.kbronet.com.tw ([123.192.253.61]:49730 "EHLO E6440" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755265AbcCPNIO (ORCPT ); Wed, 16 Mar 2016 09:08:14 -0400 X-Greylist: delayed 300 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Mar 2016 09:08:14 EDT From: Harry Pan To: LKML Cc: gs0622@gmail.com, Harry Pan , 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 Message-Id: <1458125020-13792-1-git-send-email-harry.pan@intel.com> X-Mailer: git-send-email 2.1.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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