diff options
author | Lu Baolu <baolu.lu@linux.intel.com> | 2017-11-03 17:51:32 +0100 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2017-11-03 17:51:32 +0100 |
commit | 2e2e35d512798193b4165ed884a5d1d9b181e231 (patch) | |
tree | 2b162122b86deba8109f27e5ead56ac08fc36be4 /drivers/iommu/intel-svm.c | |
parent | Merge branches 'iommu/fixes', 'arm/omap', 'arm/exynos', 'x86/amd', 'x86/vt-d'... (diff) | |
download | linux-2e2e35d512798193b4165ed884a5d1d9b181e231.tar.xz linux-2e2e35d512798193b4165ed884a5d1d9b181e231.zip |
iommu/vt-d: Missing checks for pasid tables if allocation fails
intel_svm_alloc_pasid_tables() might return an error but never be
checked by the callers. Later when intel_svm_bind_mm() is called,
there are no checks for valid pasid tables before enabling them.
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Liu, Yi L <yi.l.liu@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/iommu/intel-svm.c')
-rw-r--r-- | drivers/iommu/intel-svm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index f6697e55c2d4..43280ca282df 100644 --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -292,7 +292,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_ int pasid_max; int ret; - if (WARN_ON(!iommu)) + if (WARN_ON(!iommu || !iommu->pasid_table)) return -EINVAL; if (dev_is_pci(dev)) { |