public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module
@ 2023-04-03  9:09 Peter Ujfalusi
  2023-04-03  9:11 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2023-04-03  9:09 UTC (permalink / raw)
  To: lgirdwood, broonie
  Cc: alsa-devel, pierre-louis.bossart, ranjani.sridharan, kai.vehmanen,
	guennadi.liakhovetski, stable, error27

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: e3720f92e023 ("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>
---
Hi Mark, Dan,

This patch clarifies the print and will not rely on vsprintf internal protection
on printing the error.

Regards,
Peter

 sound/soc/sof/ipc4-topology.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 669b99a4f76e..3a5394c3dd83 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -1806,10 +1806,12 @@ static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route *
 	int ret;
 
 	if (!src_fw_module || !sink_fw_module) {
-		/* The NULL module will print as "(efault)" */
-		dev_err(sdev->dev, "source %s or sink %s widget weren't set up properly\n",
-			src_fw_module->man4_module_entry.name,
-			sink_fw_module->man4_module_entry.name);
+		dev_err(sdev->dev,
+			"cannot bind %s -> %s, no firmware module for: %s%s\n",
+			src_widget->widget->name, sink_widget->widget->name,
+			src_fw_module ? "" : " source",
+			sink_fw_module ? "" : " sink");
+
 		return -ENODEV;
 	}
 
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module
  2023-04-03  9:09 [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module Peter Ujfalusi
@ 2023-04-03  9:11 ` kernel test robot
  2023-04-03  9:13 ` Dan Carpenter
  2023-04-03 12:51 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-04-03  9:11 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

Rule: 'Cc: stable@vger.kernel.org' or 'commit <sha1> upstream.'
Subject: [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module
Link: https://lore.kernel.org/stable/20230403090909.18233-1-peter.ujfalusi%40linux.intel.com

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module
  2023-04-03  9:09 [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module Peter Ujfalusi
  2023-04-03  9:11 ` kernel test robot
@ 2023-04-03  9:13 ` Dan Carpenter
  2023-04-03 12:51 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2023-04-03  9:13 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: lgirdwood, broonie, alsa-devel, pierre-louis.bossart,
	ranjani.sridharan, kai.vehmanen, guennadi.liakhovetski, stable

On Mon, Apr 03, 2023 at 12:09:09PM +0300, Peter Ujfalusi wrote:
> 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: e3720f92e023 ("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>
> ---

Thanks!

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module
  2023-04-03  9:09 [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module Peter Ujfalusi
  2023-04-03  9:11 ` kernel test robot
  2023-04-03  9:13 ` Dan Carpenter
@ 2023-04-03 12:51 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-04-03 12:51 UTC (permalink / raw)
  To: lgirdwood, Peter Ujfalusi
  Cc: alsa-devel, pierre-louis.bossart, ranjani.sridharan, kai.vehmanen,
	guennadi.liakhovetski, stable, error27

On Mon, 03 Apr 2023 12:09:09 +0300, Peter Ujfalusi wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module
      commit: de6aa72b265b72bca2b1897d5000c8f0147d3157

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-03 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-03  9:09 [PATCH for v6.3-rc] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module Peter Ujfalusi
2023-04-03  9:11 ` kernel test robot
2023-04-03  9:13 ` Dan Carpenter
2023-04-03 12:51 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox