diff mbox series

[-next] ASoC: SOF: sof-pci-dev: fix missing pci_release_regions() on error in sof_pci_probe()

Message ID 20220426132539.416676-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit bdc8cd505b5312c3b26f13f0b6a567d97d55e715
Headers show
Series [-next] ASoC: SOF: sof-pci-dev: fix missing pci_release_regions() on error in sof_pci_probe() | expand

Commit Message

Yang Yingliang April 26, 2022, 1:25 p.m. UTC
Fix the missing pci_release_regions() before return
from sof_pci_probe() in the error handling case.

Fixes: 4bfbbb76e82e ("ASOC: SOF: pci: add ipc_type override for Intel IPC4 tests")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 sound/soc/sof/sof-pci-dev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Mark Brown April 29, 2022, 1:39 p.m. UTC | #1
On Tue, 26 Apr 2022 21:25:39 +0800, Yang Yingliang wrote:
> Fix the missing pci_release_regions() before return
> from sof_pci_probe() in the error handling case.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: SOF: sof-pci-dev: fix missing pci_release_regions() on error in sof_pci_probe()
      commit: bdc8cd505b5312c3b26f13f0b6a567d97d55e715

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 mbox series

Patch

diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index cd90da7c92c2..3b0978b02f9f 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -217,12 +217,14 @@  int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 			 desc->ipc_default, sof_pci_ipc_type);
 		if (sof_pci_ipc_type >= SOF_IPC_TYPE_COUNT) {
 			dev_err(dev, "invalid request value %d\n", sof_pci_ipc_type);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 		if (!(BIT(sof_pci_ipc_type) & desc->ipc_supported_mask)) {
 			dev_err(dev, "invalid request value %d, supported mask is %#x\n",
 				sof_pci_ipc_type, desc->ipc_supported_mask);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 		sof_pdata->ipc_type = sof_pci_ipc_type;
 	}
@@ -291,6 +293,8 @@  int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 
 	/* call sof helper for DSP hardware probe */
 	ret = snd_sof_device_probe(dev, sof_pdata);
+
+out:
 	if (ret)
 		pci_release_regions(pci);