File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1048,7 +1048,7 @@ static int fsl_pamu_add_device(struct device *dev)
10481048 struct iommu_group * group = ERR_PTR (- ENODEV );
10491049 struct pci_dev * pdev ;
10501050 const u32 * prop ;
1051- int ret , len ;
1051+ int ret = 0 , len ;
10521052
10531053 /*
10541054 * For platform devices we allocate a separate group for
@@ -1071,7 +1071,13 @@ static int fsl_pamu_add_device(struct device *dev)
10711071 if (IS_ERR (group ))
10721072 return PTR_ERR (group );
10731073
1074- ret = iommu_group_add_device (group , dev );
1074+ /*
1075+ * Check if device has already been added to an iommu group.
1076+ * Group could have already been created for a PCI device in
1077+ * the iommu_group_get_for_dev path.
1078+ */
1079+ if (!dev -> iommu_group )
1080+ ret = iommu_group_add_device (group , dev );
10751081
10761082 iommu_group_put (group );
10771083 return ret ;
You can’t perform that action at this time.
0 commit comments