[Nouveau] [PATCH 2/2] gr/gf100: do not assume a PMU is present
Alexandre Courbot
acourbot at nvidia.com
Wed Sep 2 23:32:35 PDT 2015
Some devices may not have a PMU. Avoid a NULL pointer dereference in
such cases.
Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
---
drm/nouveau/nvkm/engine/gr/gf100.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drm/nouveau/nvkm/engine/gr/gf100.c b/drm/nouveau/nvkm/engine/gr/gf100.c
index f1358a564e3e..f252fa2d7cf9 100644
--- a/drm/nouveau/nvkm/engine/gr/gf100.c
+++ b/drm/nouveau/nvkm/engine/gr/gf100.c
@@ -1499,7 +1499,8 @@ gf100_gr_oneinit(struct nvkm_gr *base)
struct nvkm_device *device = gr->base.engine.subdev.device;
int ret, i, j;
- nvkm_pmu_pgob(device->pmu, false);
+ if (device->pmu)
+ nvkm_pmu_pgob(device->pmu, false);
ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST, 0x1000, 256, false,
&gr->unk4188b4);
--
2.5.1
More information about the Nouveau
mailing list