Merge tag 'topic/drm-fixes-2015-11-11' of git://anongit.freedesktop.org/drm-intel...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / msm / msm_gpu.c
index 8f70d9248ac55f7921acdaaea221577434bb3029..6b02ada6579a737d36f6ad7403ad53519ee7e0f7 100644 (file)
@@ -651,6 +651,14 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
        if (iommu) {
                dev_info(drm->dev, "%s: using IOMMU\n", name);
                gpu->mmu = msm_iommu_new(&pdev->dev, iommu);
+               if (IS_ERR(gpu->mmu)) {
+                       ret = PTR_ERR(gpu->mmu);
+                       dev_err(drm->dev, "failed to init iommu: %d\n", ret);
+                       gpu->mmu = NULL;
+                       iommu_domain_free(iommu);
+                       goto fail;
+               }
+
        } else {
                dev_info(drm->dev, "%s: no IOMMU, fallback to VRAM carveout!\n", name);
        }