Skip to content

Commit

Permalink
iommu/amd: Clean up the cmpxchg64 invocation
Browse files Browse the repository at this point in the history
Change it as it's designed for and keep it consistent with other
places.

Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Baoquan He authored and Joerg Roedel committed Sep 19, 2016
1 parent 368d06c commit 134414f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
@@ -1342,7 +1342,8 @@ static u64 *alloc_pte(struct protection_domain *domain,

__npte = PM_LEVEL_PDE(level, virt_to_phys(page));

if (cmpxchg64(pte, __pte, __npte)) {
/* pte could have been changed somewhere. */
if (cmpxchg64(pte, __pte, __npte) != __pte) {
free_page((unsigned long)page);
continue;
}

0 comments on commit 134414f

Please sign in to comment.