]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Unmap all mapped pages in error path of map_sg
authorJerry Snitselaar <jsnitsel@redhat.com>
Sat, 19 Jan 2019 17:38:05 +0000 (10:38 -0700)
committerJoerg Roedel <jroedel@suse.de>
Tue, 22 Jan 2019 11:03:26 +0000 (12:03 +0100)
commit2c2f25ccf908162ced6491e5acc188d34feb8d70
treef8aea7ec9c19596860b497fc6e1369141b62d6d6
parenta1ee1b0e8553dfa869ccbaa537aa92be21a5f9fb
iommu/amd: Unmap all mapped pages in error path of map_sg

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: 94b0b364e7c6 ("iommu/amd: Optimize map_sg and unmap_sg")
Cc: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c