Hello Rob Clark, Commit e601ea31d66b ("drm/msm: Support pgtable preallocation") from Jun 29, 2025 (linux-next), leads to the following Smatch static checker warning:
drivers/gpu/drm/msm/msm_iommu.c:782 msm_iommu_gpu_new() error: we previously assumed 'adreno_smmu' could be null (see line 771) drivers/gpu/drm/msm/msm_iommu.c 760 struct msm_mmu *msm_iommu_gpu_new(struct device *dev, struct msm_gpu *gpu, unsigned long quirks) 761 { 762 struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(dev); 763 struct msm_iommu *iommu; 764 struct msm_mmu *mmu; 765 766 mmu = msm_iommu_new(dev, quirks); 767 if (IS_ERR_OR_NULL(mmu)) 768 return mmu; 769 770 iommu = to_msm_iommu(mmu); 771 if (adreno_smmu && adreno_smmu->cookie) { ^^^^^^^^^^^ The commit adds a NULL check. Hopefully it can be removed. 772 const struct io_pgtable_cfg *cfg = 773 adreno_smmu->get_ttbr1_cfg(adreno_smmu->cookie); 774 size_t tblsz = get_tblsz(cfg); 775 776 iommu->pt_cache = 777 kmem_cache_create("msm-mmu-pt", tblsz, tblsz, 0, NULL); 778 } 779 iommu_set_fault_handler(iommu->domain, msm_gpu_fault_handler, iommu); 780 781 /* Enable stall on iommu fault: */ --> 782 if (adreno_smmu->set_stall) ^^^^^^^^^^^ because the old code dereferences "adreno_smmu" without checking. 783 adreno_smmu->set_stall(adreno_smmu->cookie, true); 784 785 return mmu; 786 } regards, dan carpenter