]> www.infradead.org Git - linux.git/commitdiff
drm/tegra: Fix NULL vs IS_ERR() check in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 13 Sep 2024 14:34:54 +0000 (17:34 +0300)
committerThierry Reding <treding@nvidia.com>
Thu, 24 Oct 2024 16:50:04 +0000 (18:50 +0200)
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
drivers/gpu/drm/tegra/drm.c

index c9eb329665ec54b9634633e19ee1b9ba0eb89b93..34d22ba210b0b46651a2911baf6e0ce4452f78ba 100644 (file)
@@ -1153,8 +1153,8 @@ static int host1x_drm_probe(struct host1x_device *dev)
 
        if (host1x_drm_wants_iommu(dev) && device_iommu_mapped(dma_dev)) {
                tegra->domain = iommu_paging_domain_alloc(dma_dev);
-               if (!tegra->domain) {
-                       err = -ENOMEM;
+               if (IS_ERR(tegra->domain)) {
+                       err = PTR_ERR(tegra->domain);
                        goto free;
                }