summaryrefslogtreecommitdiffstats
path: root/include/linux/iommu-common.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-11-04 11:30:57 -0800
committerDavid S. Miller <davem@davemloft.net>2015-11-04 11:30:57 -0800
commitd618382ba5f1a4905db63f4980bf7b0a5826de9d (patch)
tree5bc612d222a70276b0e4d9df476b2548c1286d9e /include/linux/iommu-common.h
parent73958c651fbf70d8d8bf2a60b871af5f7a2e3199 (diff)
downloadlinux-d618382ba5f1a4905db63f4980bf7b0a5826de9d.tar.gz
linux-d618382ba5f1a4905db63f4980bf7b0a5826de9d.tar.bz2
linux-d618382ba5f1a4905db63f4980bf7b0a5826de9d.zip
iommu-common: Fix error code used in iommu_tbl_range_{alloc,free}().
The value returned from iommu_tbl_range_alloc() (and the one passed in as a fourth argument to iommu_tbl_range_free) is not a DMA address, it is rather an index into the IOMMU page table. Therefore using DMA_ERROR_CODE is not appropriate. Use a more type matching error code define, IOMMU_ERROR_CODE, and update all users of this interface. Reported-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/iommu-common.h')
-rw-r--r--include/linux/iommu-common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/iommu-common.h b/include/linux/iommu-common.h
index bbced83b32ee..376a27c9cc6a 100644
--- a/include/linux/iommu-common.h
+++ b/include/linux/iommu-common.h
@@ -7,6 +7,7 @@
#define IOMMU_POOL_HASHBITS 4
#define IOMMU_NR_POOLS (1 << IOMMU_POOL_HASHBITS)
+#define IOMMU_ERROR_CODE (~(unsigned long) 0)
struct iommu_pool {
unsigned long start;