Skip to content

Commit a0e9911

Browse files
YanfeiXujoergroedel
authored andcommitted
iommu/vt-d: Handle the failure case of dmar_reenable_qi()
dmar_reenable_qi() may not succeed. Check and return when it fails. Signed-off-by: Yanfei Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 82d9654 commit a0e9911

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2967,10 +2967,15 @@ static int init_iommu_hw(void)
29672967
{
29682968
struct dmar_drhd_unit *drhd;
29692969
struct intel_iommu *iommu = NULL;
2970+
int ret;
29702971

2971-
for_each_active_iommu(iommu, drhd)
2972-
if (iommu->qi)
2973-
dmar_reenable_qi(iommu);
2972+
for_each_active_iommu(iommu, drhd) {
2973+
if (iommu->qi) {
2974+
ret = dmar_reenable_qi(iommu);
2975+
if (ret)
2976+
return ret;
2977+
}
2978+
}
29742979

29752980
for_each_iommu(iommu, drhd) {
29762981
if (drhd->ignored) {

0 commit comments

Comments
 (0)