Commit 34e2dcc
iommu: Flow ERR_PTR out from __iommu_domain_alloc()
Most of the calling code now has error handling that can carry an error
code further up the call chain. Keep the exported interface
iommu_domain_alloc() returning NULL and reflow the internal code to use
ERR_PTR not NULL for domain allocation failure.
Optionally allow drivers to return ERR_PTR from any of the alloc ops. Many
of the new ops (user, sva, etc) already return ERR_PTR, so having two
rules is confusing and hard on drivers. This fixes a bug in DART that was
returning ERR_PTR.
Fixes: 482feb5 ("iommu/dart: Call apple_dart_finalize_domain() as part of alloc_paging()")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/linux-iommu/b85e0715-3224-4f45-ad6b-ebb9f08c015d@moroto.mountain/
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Link: https://lore.kernel.org/r/0-v2-55ae413017b8+97-domain_alloc_err_ptr_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>1 parent 2cc14f5 commit 34e2dcc
1 file changed
Lines changed: 39 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1788 | 1788 | | |
1789 | 1789 | | |
1790 | 1790 | | |
1791 | | - | |
| 1791 | + | |
1792 | 1792 | | |
1793 | 1793 | | |
1794 | 1794 | | |
| |||
1797 | 1797 | | |
1798 | 1798 | | |
1799 | 1799 | | |
1800 | | - | |
| 1800 | + | |
1801 | 1801 | | |
1802 | 1802 | | |
1803 | 1803 | | |
1804 | 1804 | | |
1805 | | - | |
| 1805 | + | |
1806 | 1806 | | |
1807 | | - | |
1808 | | - | |
| 1807 | + | |
| 1808 | + | |
1809 | 1809 | | |
1810 | 1810 | | |
1811 | 1811 | | |
| |||
2094 | 2094 | | |
2095 | 2095 | | |
2096 | 2096 | | |
2097 | | - | |
| 2097 | + | |
2098 | 2098 | | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
2099 | 2106 | | |
2100 | | - | |
| 2107 | + | |
2101 | 2108 | | |
2102 | 2109 | | |
2103 | 2110 | | |
| |||
2110 | 2117 | | |
2111 | 2118 | | |
2112 | 2119 | | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
2116 | 2128 | | |
2117 | 2129 | | |
2118 | 2130 | | |
| |||
2129 | 2141 | | |
2130 | 2142 | | |
2131 | 2143 | | |
| 2144 | + | |
| 2145 | + | |
2132 | 2146 | | |
2133 | 2147 | | |
2134 | | - | |
| 2148 | + | |
2135 | 2149 | | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
2136 | 2153 | | |
2137 | 2154 | | |
2138 | 2155 | | |
| |||
3041 | 3058 | | |
3042 | 3059 | | |
3043 | 3060 | | |
3044 | | - | |
3045 | | - | |
| 3061 | + | |
| 3062 | + | |
3046 | 3063 | | |
3047 | 3064 | | |
3048 | 3065 | | |
| |||
3243 | 3260 | | |
3244 | 3261 | | |
3245 | 3262 | | |
| 3263 | + | |
| 3264 | + | |
3246 | 3265 | | |
3247 | 3266 | | |
3248 | 3267 | | |
3249 | | - | |
3250 | | - | |
3251 | | - | |
| 3268 | + | |
| 3269 | + | |
3252 | 3270 | | |
3253 | 3271 | | |
3254 | 3272 | | |
3255 | 3273 | | |
3256 | | - | |
3257 | | - | |
3258 | | - | |
3259 | | - | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
3260 | 3278 | | |
| 3279 | + | |
3261 | 3280 | | |
3262 | 3281 | | |
3263 | 3282 | | |
| |||
0 commit comments