Skip to content

Commit 700b7b9

Browse files
ujfalusismb49
authored andcommitted
ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module
BugLink: https://bugs.launchpad.net/bugs/2023929 commit de6aa72 upstream. The original patch uses a feature in lib/vsprintf.c to handle the invalid address when tring to print *_fw_module->man4_module_entry.name when the *rc_fw_module is NULL. This case is handled by check_pointer_msg() internally and turns the invalid pointer to '(efault)' for printing but it is hiding useful information about the circumstances. Change the print to emmit the name of the widget and a note on which side's fw_module is missing. Fixes: e3720f9 ("ASoC: SOF: avoid a NULL dereference with unsupported widgets") Reported-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/alsa-devel/4826f662-42f0-4a82-ba32-8bf5f8a03256@kili.mountain/ Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Rule: 'Cc: stable@vger.kernel.org' or 'commit <sha1> upstream.' Link: https://lore.kernel.org/r/20230403090909.18233-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 5029221 commit 700b7b9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

sound/soc/sof/ipc4-topology.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,10 +1687,12 @@ static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route *
16871687
int ret;
16881688

16891689
if (!src_fw_module || !sink_fw_module) {
1690-
/* The NULL module will print as "(efault)" */
1691-
dev_err(sdev->dev, "source %s or sink %s widget weren't set up properly\n",
1692-
src_fw_module->man4_module_entry.name,
1693-
sink_fw_module->man4_module_entry.name);
1690+
dev_err(sdev->dev,
1691+
"cannot bind %s -> %s, no firmware module for: %s%s\n",
1692+
src_widget->widget->name, sink_widget->widget->name,
1693+
src_fw_module ? "" : " source",
1694+
sink_fw_module ? "" : " sink");
1695+
16941696
return -ENODEV;
16951697
}
16961698

0 commit comments

Comments
 (0)