summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2017-06-28 12:45:31 +0200
committerJoerg Roedel <jroedel@suse.de>2017-06-28 13:29:45 +0200
commit7f7a2304aabc4a8102bbbbeed2ec9eaee4a480c2 (patch)
treeab046f0bf6391cdc57f081537702231c03330bff /drivers/iommu/iommu.c
parentiommu/iova: Don't disable preempt around this_cpu_ptr() (diff)
downloadlinux-7f7a2304aabc4a8102bbbbeed2ec9eaee4a480c2.tar.xz
linux-7f7a2304aabc4a8102bbbbeed2ec9eaee4a480c2.zip
iommu: Return ERR_PTR() values from device_group call-backs
The generic device_group call-backs in iommu.c return NULL in case of error. Since they are getting ERR_PTR values from iommu_group_alloc(), just pass them up instead. Reported-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r--drivers/iommu/iommu.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index cf7ca7e70777..de09e1e35830 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -915,13 +915,7 @@ static int get_pci_alias_or_group(struct pci_dev *pdev, u16 alias, void *opaque)
*/
struct iommu_group *generic_device_group(struct device *dev)
{
- struct iommu_group *group;
-
- group = iommu_group_alloc();
- if (IS_ERR(group))
- return NULL;
-
- return group;
+ return iommu_group_alloc();
}
/*
@@ -988,11 +982,7 @@ struct iommu_group *pci_device_group(struct device *dev)
return group;
/* No shared group found, allocate new */
- group = iommu_group_alloc();
- if (IS_ERR(group))
- return NULL;
-
- return group;
+ return iommu_group_alloc();
}
/**