Message ID | 20230329113828.28562-1-peter.ujfalusi@linux.intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | e3720f92e0237921da537e47a0b24e27899203f8 |
Headers | show |
Series | [for,v6.3-rc] ASoC: SOF: avoid a NULL dereference with unsupported widgets | expand |
On Wed, 29 Mar 2023 14:38:28 +0300, Peter Ujfalusi wrote: > If an IPC4 topology contains an unsupported widget, its .module_info > field won't be set, then sof_ipc4_route_setup() will cause a kernel > Oops trying to dereference it. Add a check for such cases. > > Applied to broonie/sound.git for-6.3 Thanks! [1/1] ASoC: SOF: avoid a NULL dereference with unsupported widgets commit: e3720f92e0237921da537e47a0b24e27899203f8 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/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index a623707c8ffc..669b99a4f76e 100644 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -1805,6 +1805,14 @@ static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route * u32 header, extension; 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); + return -ENODEV; + } + sroute->src_queue_id = sof_ipc4_get_queue_id(src_widget, sink_widget, SOF_PIN_TYPE_SOURCE); if (sroute->src_queue_id < 0) {