Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/tegra: Fix NULL vs IS_ERR() check in probe()

The iommu_paging_domain_alloc() function doesn't return NULL pointers,
it returns error pointers. Update the check to match.

Fixes: 45c690aea8ee ("drm/tegra: Use iommu_paging_domain_alloc()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ba31cf3a-af3d-4ff1-87a8-f05aaf8c780b@stanley.mountain

authored by

Dan Carpenter and committed by
Thierry Reding
a85df8c7 5c238782

+2 -2
+2 -2
drivers/gpu/drm/tegra/drm.c
··· 1153 1153 1154 1154 if (host1x_drm_wants_iommu(dev) && device_iommu_mapped(dma_dev)) { 1155 1155 tegra->domain = iommu_paging_domain_alloc(dma_dev); 1156 - if (!tegra->domain) { 1157 - err = -ENOMEM; 1156 + if (IS_ERR(tegra->domain)) { 1157 + err = PTR_ERR(tegra->domain); 1158 1158 goto free; 1159 1159 } 1160 1160