Commit fa4d84e6 authored by Jan Beulich's avatar Jan Beulich

IOMMU: make domctl handler tolerate NULL domain

Besides the reporter's issue of hitting a NULL deref when !CONFIG_GDBSX,
XEN_DOMCTL_test_assign_device can legitimately end up having NULL passed
here, when the domctl was passed DOMID_INVALID.

Fixes: 71e617a6 ("use is_iommu_enabled() where appropriate...")
Reported-by: default avatarCheyenne Wills <cheyenne.wills@gmail.com>
Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Reviewed-by: default avatarPaul Durrant <paul@xen.org>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
parent 9cd7e31b
...@@ -568,7 +568,7 @@ int iommu_do_domctl( ...@@ -568,7 +568,7 @@ int iommu_do_domctl(
{ {
int ret = -ENODEV; int ret = -ENODEV;
if ( !is_iommu_enabled(d) ) if ( !(d ? is_iommu_enabled(d) : iommu_enabled) )
return -EOPNOTSUPP; return -EOPNOTSUPP;
#ifdef CONFIG_HAS_PCI #ifdef CONFIG_HAS_PCI
......
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