aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org> 2017-01-27 12:10:58 -0800
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2017-01-27 12:10:58 -0800
commit3aebae061cea6f6627ab882a73de7b0b21af3127 (patch)
tree4ea296a2b63b38e69e37434e7976b45cfc816c0d
parentMerge tag 'media/v4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mc... (diff)
parentvfio/spapr: fail tce_iommu_attach_group() when iommu_data is null (diff)
downloadlinux-3aebae061cea6f6627ab882a73de7b0b21af3127.tar.gz
linux-3aebae061cea6f6627ab882a73de7b0b21af3127.tar.bz2
linux-3aebae061cea6f6627ab882a73de7b0b21af3127.zip
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 ||