Commit f8bb3ed3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Airlie
Browse files

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: 76b8f81a ("drm/nouveau: improve handling of 64-bit BARs")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarTimur Tabi <ttabi@nvidia.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://lore.kernel.org/dri-devel/334404bdf60765cb5a8e855a74c688bc537531ee.camel@nvidia.com/T/#t
parent 002619c8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);