linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: Intel: avs: Fix uninitialized pointer error in probe()
@ 2025-07-30 12:49 Cezary Rojewski
  2025-07-30 16:03 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Cezary Rojewski @ 2025-07-30 12:49 UTC (permalink / raw)
  To: broonie; +Cc: tiwai, perex, amadeuszx.slawinski, linux-sound, Cezary Rojewski

If pcim_request_all_regions() fails, error path operates on
uninitialized 'bus' pointer. Found out by Coverity static analyzer.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
Changes in v2:
- dropped the 1/2 patch:
  ASoC: Intel: avs: Synchronize happy and error paths in PCI probe
  as it held no real value. It's actually common in the drivers/ code to
  have pci_set_master() at the beginning of the probe() function, not at
  its end. And thus there's no need to fix the error path.

 sound/soc/intel/avs/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c
index 5b21812be9d6..7b7acb523716 100644
--- a/sound/soc/intel/avs/core.c
+++ b/sound/soc/intel/avs/core.c
@@ -445,6 +445,8 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
 	adev = devm_kzalloc(dev, sizeof(*adev), GFP_KERNEL);
 	if (!adev)
 		return -ENOMEM;
+	bus = &adev->base.core;
+
 	ret = avs_bus_init(adev, pci, id);
 	if (ret < 0) {
 		dev_err(dev, "failed to init avs bus: %d\n", ret);
@@ -455,7 +457,6 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
 	if (ret < 0)
 		return ret;
 
-	bus = &adev->base.core;
 	bus->addr = pci_resource_start(pci, 0);
 	bus->remap_addr = pci_ioremap_bar(pci, 0);
 	if (!bus->remap_addr) {
-- 
2.25.1


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

* Re: [PATCH v2] ASoC: Intel: avs: Fix uninitialized pointer error in probe()
  2025-07-30 12:49 [PATCH v2] ASoC: Intel: avs: Fix uninitialized pointer error in probe() Cezary Rojewski
@ 2025-07-30 16:03 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-07-30 16:03 UTC (permalink / raw)
  To: Cezary Rojewski; +Cc: tiwai, perex, amadeuszx.slawinski, linux-sound

On Wed, 30 Jul 2025 14:49:06 +0200, Cezary Rojewski wrote:
> If pcim_request_all_regions() fails, error path operates on
> uninitialized 'bus' pointer. Found out by Coverity static analyzer.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: Intel: avs: Fix uninitialized pointer error in probe()
      commit: 11f74f48c14c1f4fe16541900ea5944c42e30ccf

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] 2+ messages in thread

end of thread, other threads:[~2025-07-30 16:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-30 12:49 [PATCH v2] ASoC: Intel: avs: Fix uninitialized pointer error in probe() Cezary Rojewski
2025-07-30 16:03 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).