From: Joerg Roedel Date: Mon, 18 Aug 2014 22:19:26 +0000 (+0200) Subject: iommu/core: Check for the right function pointer in iommu_map() X-Git-Tag: v3.12.40~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c45f743a171baa54cc18783f954799e2b30452e8;p=thirdparty%2Fkernel%2Fstable.git iommu/core: Check for the right function pointer in iommu_map() commit 9db4ad9183aad0e9567f6afb23db1bdc9aa6c2a9 upstream. Check for the ->map and not the ->unmap pointer. Signed-off-by: Joerg Roedel Signed-off-by: Jiri Slaby --- diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index fbe9ca734f8fe..9d71a57c96b14 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -794,7 +794,7 @@ int iommu_map(struct iommu_domain *domain, unsigned long iova, size_t orig_size = size; int ret = 0; - if (unlikely(domain->ops->unmap == NULL || + if (unlikely(domain->ops->map == NULL || domain->ops->pgsize_bitmap == 0UL)) return -ENODEV;