Commit c947dfcf authored by Zhou Guanghui's avatar Zhou Guanghui Committed by Yang Yingliang
Browse files

iommu: fix NULL pointer when release iopf queue



ascend inclusion
category: bugfix
bugzilla: NA
CVE: NA

----------------------------------

The iopf_queue should be checked when release the related resources.
Since, the value of iopf_queue may be NULL. For example, when the SMMU
does not support the STALL and PRI features or the driver fails to
initialize, the iopf_queue will be NULL pointer.

Signed-off-by: default avatarZhou Guanghui <zhouguanghui1@huawei.com>
Signed-off-by: default avatarBixuan Cui <cuibixuan@huawei.com>
Signed-off-by: default avatarchenjiankang <chenjiankang1@huawei.com>
Signed-off-by: default avatarxiangrui <rui.xiang@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 17498bd2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3782,7 +3782,9 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
{
	struct arm_smmu_device *smmu = platform_get_drvdata(pdev);

	if (smmu->iopf_queue)
		iopf_queue_free(smmu->iopf_queue);

	arm_smmu_device_disable(smmu);

	return 0;