From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Takashi Iwai <tiwai@suse.com>,
Jie Yang <yang.jie@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Mark Brown <broonie@kernel.org>,
Mateusz Gorski <mateusz.gorski@linux.intel.com>,
Lukasz Majczak <lma@semihalf.com>
Subject: Re: [PATCH v2 1/2] ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete
Date: Thu, 21 Jan 2021 19:46:23 +0200 [thread overview]
Message-ID: <YAm977TOZBgaQChA@smile.fi.intel.com> (raw)
In-Reply-To: <20210121171644.131059-1-ribalda@chromium.org>
On Thu, Jan 21, 2021 at 06:16:43PM +0100, Ricardo Ribalda wrote:
> If dobj->control is not initialized we end up in an OOPs during
> skl_tplg_complete:
>
> [ 26.553358] BUG: kernel NULL pointer dereference, address:
> 0000000000000078
> [ 26.561151] #PF: supervisor read access in kernel mode
> [ 26.566897] #PF: error_code(0x0000) - not-present page
> [ 26.572642] PGD 0 P4D 0
> [ 26.575479] Oops: 0000 [#1] PREEMPT SMP PTI
> [ 26.580158] CPU: 2 PID: 2082 Comm: udevd Tainted: G C
> 5.4.81 #4
> [ 26.588232] Hardware name: HP Soraka/Soraka, BIOS
> Google_Soraka.10431.106.0 12/03/2019
> [ 26.597082] RIP: 0010:skl_tplg_complete+0x70/0x144 [snd_soc_skl]
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Fixes: 2d744ecf2b98 ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHL")
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> sound/soc/intel/skylake/skl-topology.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
> index ae466cd59292..1ef30ca45410 100644
> --- a/sound/soc/intel/skylake/skl-topology.c
> +++ b/sound/soc/intel/skylake/skl-topology.c
> @@ -3619,15 +3619,16 @@ static void skl_tplg_complete(struct snd_soc_component *component)
>
> list_for_each_entry(dobj, &component->dobj_list, list) {
> struct snd_kcontrol *kcontrol = dobj->control.kcontrol;
> - struct soc_enum *se =
> - (struct soc_enum *)kcontrol->private_value;
> - char **texts = dobj->control.dtexts;
> + struct soc_enum *se;
> + char **texts;
A nit-pick: Can we place this after below line?
> char chan_text[4];
>
> - if (dobj->type != SND_SOC_DOBJ_ENUM ||
> - dobj->control.kcontrol->put !=
> - skl_tplg_multi_config_set_dmic)
> + if (dobj->type != SND_SOC_DOBJ_ENUM || !kcontrol ||
> + kcontrol->put != skl_tplg_multi_config_set_dmic)
> continue;
> +
> + se = (struct soc_enum *)kcontrol->private_value;
> + texts = dobj->control.dtexts;
> sprintf(chan_text, "c%d", mach->mach_params.dmic_num);
>
> for (i = 0; i < se->items; i++) {
> --
> 2.30.0.296.g2bfb1c46d8-goog
>
--
With Best Regards,
Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Jie Yang <yang.jie@linux.intel.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Mateusz Gorski <mateusz.gorski@linux.intel.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Lukasz Majczak <lma@semihalf.com>
Subject: Re: [PATCH v2 1/2] ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete
Date: Thu, 21 Jan 2021 19:46:23 +0200 [thread overview]
Message-ID: <YAm977TOZBgaQChA@smile.fi.intel.com> (raw)
In-Reply-To: <20210121171644.131059-1-ribalda@chromium.org>
On Thu, Jan 21, 2021 at 06:16:43PM +0100, Ricardo Ribalda wrote:
> If dobj->control is not initialized we end up in an OOPs during
> skl_tplg_complete:
>
> [ 26.553358] BUG: kernel NULL pointer dereference, address:
> 0000000000000078
> [ 26.561151] #PF: supervisor read access in kernel mode
> [ 26.566897] #PF: error_code(0x0000) - not-present page
> [ 26.572642] PGD 0 P4D 0
> [ 26.575479] Oops: 0000 [#1] PREEMPT SMP PTI
> [ 26.580158] CPU: 2 PID: 2082 Comm: udevd Tainted: G C
> 5.4.81 #4
> [ 26.588232] Hardware name: HP Soraka/Soraka, BIOS
> Google_Soraka.10431.106.0 12/03/2019
> [ 26.597082] RIP: 0010:skl_tplg_complete+0x70/0x144 [snd_soc_skl]
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Fixes: 2d744ecf2b98 ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHL")
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> sound/soc/intel/skylake/skl-topology.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
> index ae466cd59292..1ef30ca45410 100644
> --- a/sound/soc/intel/skylake/skl-topology.c
> +++ b/sound/soc/intel/skylake/skl-topology.c
> @@ -3619,15 +3619,16 @@ static void skl_tplg_complete(struct snd_soc_component *component)
>
> list_for_each_entry(dobj, &component->dobj_list, list) {
> struct snd_kcontrol *kcontrol = dobj->control.kcontrol;
> - struct soc_enum *se =
> - (struct soc_enum *)kcontrol->private_value;
> - char **texts = dobj->control.dtexts;
> + struct soc_enum *se;
> + char **texts;
A nit-pick: Can we place this after below line?
> char chan_text[4];
>
> - if (dobj->type != SND_SOC_DOBJ_ENUM ||
> - dobj->control.kcontrol->put !=
> - skl_tplg_multi_config_set_dmic)
> + if (dobj->type != SND_SOC_DOBJ_ENUM || !kcontrol ||
> + kcontrol->put != skl_tplg_multi_config_set_dmic)
> continue;
> +
> + se = (struct soc_enum *)kcontrol->private_value;
> + texts = dobj->control.dtexts;
> sprintf(chan_text, "c%d", mach->mach_params.dmic_num);
>
> for (i = 0; i < se->items; i++) {
> --
> 2.30.0.296.g2bfb1c46d8-goog
>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-01-21 17:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 17:16 [PATCH v2 1/2] ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete Ricardo Ribalda
2021-01-21 17:16 ` [PATCH v2 2/2] ASoC: Intel: Skylake: Zero snd_ctl_elem_value Ricardo Ribalda
2021-01-21 17:34 ` Rojewski, Cezary
2021-01-21 17:34 ` Rojewski, Cezary
2021-01-21 17:47 ` Andy Shevchenko
2021-01-21 17:47 ` Andy Shevchenko
2021-01-21 17:18 ` [PATCH v2 1/2] ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete Ricardo Ribalda
2021-01-21 17:33 ` Rojewski, Cezary
2021-01-21 17:33 ` Rojewski, Cezary
2021-01-21 17:39 ` Łukasz Majczak
2021-01-21 17:39 ` Łukasz Majczak
2021-01-21 17:46 ` Andy Shevchenko [this message]
2021-01-21 17:46 ` Andy Shevchenko
2021-01-21 19:39 ` 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=YAm977TOZBgaQChA@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lma@semihalf.com \
--cc=mateusz.gorski@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ribalda@chromium.org \
--cc=tiwai@suse.com \
--cc=yang.jie@linux.intel.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.