Skip to contentSkip to conversation

drm/nouveau/tegra: Fix error pointer vs NULL return in nvkm_device_tegra_resource_addr()

PATCH In review Dan Carpenter 2 participants 2 messages May 23, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/tegra: Fix error pointer vs NULL return in nvkm_device_tegra_resource_addr()

The nvkm_device_tegra_resource() function returns a mix of error pointers and NULL. The callers only expect it to return NULL on error. Change it to only return NULL.

Fixes 76b8f81a5b92 ("drm/nouveau: improve handling of 64-bit BARs")
---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +1 -1
index 0ca2dfe99676..114e50ca1827 100644
@@ -196,7 +196,7 @@ nvkm_device_tegra_resource(struct nvkm_device *device, enum nvkm_bar_id bar)
 	case NVKM_BAR1_FB : idx = 1; break;
 	default:
 		WARN_ON(1);
-		return ERR_PTR(-EINVAL);
+		return NULL;
 	}
 
 	return platform_get_resource(tdev->pdev, IORESOURCE_MEM, idx);
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

The nvkm_device_tegra_resource() function returns a mix of error pointers and NULL.  The callers only expect it to return NULL on error.  Change it to only return NULL.

Fixes 76b8f81a5b92 ("drm/nouveau: improve handling of 64-bit BARs")