Commit a6a9a5d
iommu: Fix refcount leak in iommu_device_claim_dma_owner
iommu_group_get() returns the group with the reference incremented.
Move iommu_group_get() after owner check to fix the refcount leak.
Fixes: 89395cc ("iommu: Add device-centric DMA ownership interfaces")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20221230083100.1489569-1-linmq006@gmail.com
[ joro: Remove *group = NULL initialization ]
Signed-off-by: Joerg Roedel <jroedel@suse.de>1 parent 32ea2c5 commit a6a9a5d
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3185 | 3185 | | |
3186 | 3186 | | |
3187 | 3187 | | |
3188 | | - | |
| 3188 | + | |
3189 | 3189 | | |
3190 | 3190 | | |
3191 | | - | |
3192 | | - | |
3193 | 3191 | | |
3194 | 3192 | | |
3195 | 3193 | | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
3196 | 3198 | | |
3197 | 3199 | | |
3198 | 3200 | | |
| |||
0 commit comments