Commit bdc8cd50 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

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

Fix the missing pci_release_regions() before return
from sof_pci_probe() in the error handling case.

Fixes: 4bfbbb76 ("ASOC: SOF: pci: add ipc_type override for Intel IPC4 tests")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220426132539.416676-1-yangyingliang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ce216cfa
...@@ -217,12 +217,14 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) ...@@ -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); desc->ipc_default, sof_pci_ipc_type);
if (sof_pci_ipc_type >= SOF_IPC_TYPE_COUNT) { if (sof_pci_ipc_type >= SOF_IPC_TYPE_COUNT) {
dev_err(dev, "invalid request value %d\n", sof_pci_ipc_type); 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)) { if (!(BIT(sof_pci_ipc_type) & desc->ipc_supported_mask)) {
dev_err(dev, "invalid request value %d, supported mask is %#x\n", dev_err(dev, "invalid request value %d, supported mask is %#x\n",
sof_pci_ipc_type, desc->ipc_supported_mask); sof_pci_ipc_type, desc->ipc_supported_mask);
return -EINVAL; ret = -EINVAL;
goto out;
} }
sof_pdata->ipc_type = sof_pci_ipc_type; 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) ...@@ -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 */ /* call sof helper for DSP hardware probe */
ret = snd_sof_device_probe(dev, sof_pdata); ret = snd_sof_device_probe(dev, sof_pdata);
out:
if (ret) if (ret)
pci_release_regions(pci); pci_release_regions(pci);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment