Skip to content

Commit db40d29

Browse files
z3nturobclark
authored andcommitted
drm/msm/iommu: Fix null pointer dereference in no-IOMMU case
In the case that no IOMMU is available, msm_iommu_new can return NULL which should be handled. Without we will get a NULL pointer dereference in the next statement when we try to use the mmu variable. Fixes: 8cceb77 ("drm/msm/adreno: stall translation on fault for all GPU families") Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/535915/ Link: https://lore.kernel.org/r/20230508-6-4-drm-msm-iommu-fixup-v1-1-a7a21ec94f5b@z3ntu.xyz Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent ca29699 commit db40d29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/msm/msm_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ struct msm_mmu *msm_iommu_gpu_new(struct device *dev, struct msm_gpu *gpu, unsig
410410
struct msm_mmu *mmu;
411411

412412
mmu = msm_iommu_new(dev, quirks);
413-
if (IS_ERR(mmu))
413+
if (IS_ERR_OR_NULL(mmu))
414414
return mmu;
415415

416416
iommu = to_msm_iommu(mmu);

0 commit comments

Comments
 (0)