mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH next] drm/tegra: Fix NULL vs IS_ERR() check in probe()
@ 2024-09-13 14:34 Dan Carpenter
  2024-09-14  2:02 ` Baolu Lu
  2024-10-24 16:50 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-09-13 14:34 UTC (permalink / raw)
  To: Lu Baolu
  Cc: Thierry Reding, Mikko Perttunen, David Airlie, Simona Vetter,
	Jonathan Hunter, Lyude Paul, dri-devel, linux-tegra,
	linux-kernel, kernel-janitors

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>
---
 drivers/gpu/drm/tegra/drm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index c9eb329665ec..34d22ba210b0 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -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;
 		}
 
-- 
2.45.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-24 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-13 14:34 [PATCH next] drm/tegra: Fix NULL vs IS_ERR() check in probe() Dan Carpenter
2024-09-14  2:02 ` Baolu Lu
2024-10-24 16:50 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®