summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-27 12:10:58 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-27 12:10:58 -0800
commit3aebae061cea6f6627ab882a73de7b0b21af3127 (patch)
tree4ea296a2b63b38e69e37434e7976b45cfc816c0d
parent9d1d166f18f8f0f332573b8d2e28e5b3291f09c5 (diff)
parentbd00fdf198e2da475a2f4265a83686ab42d998a8 (diff)
Merge tag 'vfio-v4.10-rc6' of git://github.com/awilliam/linux-vfio
Pull VFIO fix from Alex Williamson: "mdev IOMMU groups are not yet compatible with the powerpc SPAPR IOMMU backend, detect and fail group attach (Greg Kurz)" * tag 'vfio-v4.10-rc6' of git://github.com/awilliam/linux-vfio: vfio/spapr: fail tce_iommu_attach_group() when iommu_data is null
-rw-r--r--drivers/vfio/vfio_iommu_spapr_tce.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
index c8823578a1b2..128d10282d16 100644
--- a/drivers/vfio/vfio_iommu_spapr_tce.c
+++ b/drivers/vfio/vfio_iommu_spapr_tce.c
@@ -1270,6 +1270,10 @@ static int tce_iommu_attach_group(void *iommu_data,
/* pr_debug("tce_vfio: Attaching group #%u to iommu %p\n",
iommu_group_id(iommu_group), iommu_group); */
table_group = iommu_group_get_iommudata(iommu_group);
+ if (!table_group) {
+ ret = -ENODEV;
+ goto unlock_exit;
+ }
if (tce_groups_attached(container) && (!table_group->ops ||
!table_group->ops->take_ownership ||