• Jerry Snitselaar's avatar
    iommu/amd: Unmap all mapped pages in error path of map_sg · f1724c08
    Jerry Snitselaar authored
    In the error path of map_sg there is an incorrect if condition
    for breaking out of the loop that searches the scatterlist
    for mapped pages to unmap. Instead of breaking out of the
    loop once all the pages that were mapped have been unmapped,
    it will break out of the loop after it has unmapped 1 page.
    Fix the condition, so it breaks out of the loop only after
    all the mapped pages have been unmapped.
    
    Fixes: 80187fd3 ("iommu/amd: Optimize map_sg and unmap_sg")
    Cc: Joerg Roedel <joro@8bytes.org>
    Signed-off-by: default avatarJerry Snitselaar <jsnitsel@redhat.com>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    f1724c08
amd_iommu.c 105 KB