diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index a7dd00cdb90b05e6117c77c7839dd2133a65e956..c0728bc12cf8710710f62185e12145b939550471 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -3784,7 +3784,9 @@ static int arm_smmu_device_remove(struct platform_device *pdev) { struct arm_smmu_device *smmu = platform_get_drvdata(pdev); - iopf_queue_free(smmu->iopf_queue); + if (smmu->iopf_queue) + iopf_queue_free(smmu->iopf_queue); + arm_smmu_device_disable(smmu); return 0;