Message ID | 20241008-tegra-dapm-v2-1-5e999cb5f0e7@skidata.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 3fe9f5882cf71573516749b0bb687ef88f470d1d |
Headers | show |
Series | [v2] ASoC: dapm: avoid container_of() to get component | expand |
On Tue, 08 Oct 2024 13:36:14 +0200, Benjamin Bara wrote: > The current implementation does not work for widgets of DAPMs without > component, as snd_soc_dapm_to_component() requires it. If the widget is > directly owned by the card, e.g. as it is the case for the tegra > implementation, the call leads to UB. Therefore directly access the > component of the widget's DAPM to be able to check if a component is > available. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: dapm: avoid container_of() to get component commit: 3fe9f5882cf71573516749b0bb687ef88f470d1d All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 9330f1a3f7589dc467c04238830f2009a619a998..c34934c31ffec3970b34b24dcaa0826dfb7d8e86 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2785,10 +2785,10 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_update_dai); int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s) { - struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm); + struct snd_soc_component *component = widget->dapm->component; const char *wname = widget->name; - if (component->name_prefix) + if (component && component->name_prefix) wname += strlen(component->name_prefix) + 1; /* plus space */ return strcmp(wname, s);