IPU7 ISYS and PSYS auxiliary devices are released after
ipu7_bus_del_devices(), so driver can not reference the MMU devices
from ISYS and PSYS auxiliary devices, so move the MMUs cleanup before
releasing the auxiliary devices.
Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
[Sakari Ailus: Drop extra newline.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
if (!IS_ERR_OR_NULL(isp->fw_code_region))
vfree(isp->fw_code_region);
+ ipu7_mmu_cleanup(isp->isys->mmu);
+ ipu7_mmu_cleanup(isp->psys->mmu);
+
ipu7_bus_del_devices(pdev);
pm_runtime_forbid(&pdev->dev);
ipu_buttress_exit(isp);
release_firmware(isp->cpd_fw);
-
- ipu7_mmu_cleanup(isp->psys->mmu);
- ipu7_mmu_cleanup(isp->isys->mmu);
}
static void ipu7_pci_reset_prepare(struct pci_dev *pdev)