public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] iommu: Return ERR_PTR() values from device_group call-backs
@ 2017-06-28 12:00 Joerg Roedel
  2017-06-28 12:00 ` [PATCH 2/3] iommu/omap: Return ERR_PTR in device_group call-back Joerg Roedel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Joerg Roedel @ 2017-06-28 12:00 UTC (permalink / raw)
  To: iommu; +Cc: linux-kernel, Gerald Schaefer, Suman Anna, Joerg Roedel

From: Joerg Roedel <jroedel@suse.de>

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>
---
 drivers/iommu/iommu.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index cf7ca7e..de09e1e 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();
 }
 
 /**
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-28 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28 12:00 [PATCH 1/3] iommu: Return ERR_PTR() values from device_group call-backs Joerg Roedel
2017-06-28 12:00 ` [PATCH 2/3] iommu/omap: Return ERR_PTR in device_group call-back Joerg Roedel
2017-06-28 16:32   ` Suman Anna
2017-06-28 12:00 ` [PATCH 3/3] iommu: Warn once when device_group callback returns NULL Joerg Roedel
2017-06-28 15:48 ` [PATCH 1/3] iommu: Return ERR_PTR() values from device_group call-backs Gerald Schaefer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox