mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
media: ipu6: Fix RPM reference leak in probe error paths
Several error paths in ipu6_pci_probe() were jumping directly to
out_ipu6_bus_del_devices without releasing the runtime PM reference.
Add pm_runtime_put_sync() before cleaning up other resources.
Cc: Stable@vger.kernel.org
Fixes: 25fedc0219 ("media: intel/ipu6: add Intel IPU6 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
3e0fcc9127
commit
6099f78e4c
|
|
@ -630,21 +630,21 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
if (ret) {
|
||||
dev_err_probe(&isp->pdev->dev, ret,
|
||||
"Failed to set MMU hardware\n");
|
||||
goto out_ipu6_bus_del_devices;
|
||||
goto out_ipu6_rpm_put;
|
||||
}
|
||||
|
||||
ret = ipu6_buttress_map_fw_image(isp->psys, isp->cpd_fw,
|
||||
&isp->psys->fw_sgt);
|
||||
if (ret) {
|
||||
dev_err_probe(&isp->pdev->dev, ret, "failed to map fw image\n");
|
||||
goto out_ipu6_bus_del_devices;
|
||||
goto out_ipu6_rpm_put;
|
||||
}
|
||||
|
||||
ret = ipu6_cpd_create_pkg_dir(isp->psys, isp->cpd_fw->data);
|
||||
if (ret) {
|
||||
dev_err_probe(&isp->pdev->dev, ret,
|
||||
"failed to create pkg dir\n");
|
||||
goto out_ipu6_bus_del_devices;
|
||||
goto out_ipu6_rpm_put;
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(dev, pdev->irq, ipu6_buttress_isr,
|
||||
|
|
@ -652,7 +652,7 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
IRQF_SHARED, IPU6_NAME, isp);
|
||||
if (ret) {
|
||||
dev_err_probe(dev, ret, "Requesting irq failed\n");
|
||||
goto out_ipu6_bus_del_devices;
|
||||
goto out_ipu6_rpm_put;
|
||||
}
|
||||
|
||||
ret = ipu6_buttress_authenticate(isp);
|
||||
|
|
@ -683,6 +683,8 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
|
||||
out_free_irq:
|
||||
devm_free_irq(dev, pdev->irq, isp);
|
||||
out_ipu6_rpm_put:
|
||||
pm_runtime_put_sync(&isp->psys->auxdev.dev);
|
||||
out_ipu6_bus_del_devices:
|
||||
if (isp->psys) {
|
||||
ipu6_cpd_free_pkg_dir(isp->psys);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user