iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [patch] iommu/amd: Missing error code in amd_iommu_init_device()
@ 2016-11-24 11:05 Dan Carpenter
  2016-11-29 16:40 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-11-24 11:05 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

We should set "ret" to -EINVAL if iommu_group_get() fails.

Fixes: 55c99a4dc50f ("iommu/amd: Use iommu_attach_group()")
Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c
index 594849a..f8ed8c9 100644
--- a/drivers/iommu/amd_iommu_v2.c
+++ b/drivers/iommu/amd_iommu_v2.c
@@ -805,8 +805,10 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids)
 		goto out_free_domain;
 
 	group = iommu_group_get(&pdev->dev);
-	if (!group)
+	if (!group) {
+		ret = -EINVAL;
 		goto out_free_domain;
+	}
 
 	ret = iommu_attach_group(dev_state->domain, group);
 	if (ret != 0)

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

* Re: [patch] iommu/amd: Missing error code in amd_iommu_init_device()
  2016-11-24 11:05 [patch] iommu/amd: Missing error code in amd_iommu_init_device() Dan Carpenter
@ 2016-11-29 16:40 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2016-11-29 16:40 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: iommu, kernel-janitors

On Thu, Nov 24, 2016 at 02:05:44PM +0300, Dan Carpenter wrote:
> We should set "ret" to -EINVAL if iommu_group_get() fails.
> 
> Fixes: 55c99a4dc50f ("iommu/amd: Use iommu_attach_group()")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.


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

end of thread, other threads:[~2016-11-29 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-24 11:05 [patch] iommu/amd: Missing error code in amd_iommu_init_device() Dan Carpenter
2016-11-29 16:40 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).