]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
amd/iommu: fix missing unlock in iommu_read_log
authorRoger Pau Monné <roger.pau@citrix.com>
Wed, 19 Feb 2020 11:19:04 +0000 (12:19 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 19 Feb 2020 11:59:39 +0000 (11:59 +0000)
Coverity-ID: 1458632
Fixes: 709d3ddea2d5e ('AMD/IOMMU: Common the #732/#733 errata handling in iommu_read_log()')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/drivers/passthrough/amd/iommu_init.c

index 4c86848c52cfe6e93d10619154e2c76461cc7d75..d9a4b0f80208413bf420122dd914a31d7d612afd 100644 (file)
@@ -338,7 +338,7 @@ static int iommu_read_log(struct amd_iommu *iommu,
             {
                 AMD_IOMMU_DEBUG("AMD-Vi: No entry written to %s Log\n",
                                 log == &iommu->event_log ? "Event" : "PPR");
-                return 0;
+                goto out;
             }
             udelay(1);
             code = MASK_EXTR(ACCESS_ONCE(entry[1]), IOMMU_EVENT_CODE_MASK);
@@ -357,6 +357,7 @@ static int iommu_read_log(struct amd_iommu *iommu,
         writel(log->head, iommu->mmio_base + head_offset);
     }
 
+ out:
     spin_unlock(&log->lock);
    
     return 0;