Commit 2e2e35d5 authored by Lu Baolu's avatar Lu Baolu Committed by Alex Williamson

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: default avatarAshok Raj <ashok.raj@intel.com>
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: default avatarLiu, Yi L <yi.l.liu@intel.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent a5934725
...@@ -292,7 +292,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_ ...@@ -292,7 +292,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_
int pasid_max; int pasid_max;
int ret; int ret;
if (WARN_ON(!iommu)) if (WARN_ON(!iommu || !iommu->pasid_table))
return -EINVAL; return -EINVAL;
if (dev_is_pci(dev)) { if (dev_is_pci(dev)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment