Commit 44d9de58 authored by Samuel Pitoiset's avatar Samuel Pitoiset Committed by Ben Skeggs

drm/nouveau/pm: prevent creating a perfctr object when signals are not found

Since a new class has been introduced to query signals, we can now
return an error when the userspace wants to monitor unknown signals.
Signed-off-by: default avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 5a0bc4b5
...@@ -294,6 +294,9 @@ nvkm_perfctr_ctor(struct nvkm_object *parent, struct nvkm_object *engine, ...@@ -294,6 +294,9 @@ nvkm_perfctr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
return -EINVAL; return -EINVAL;
} }
if (!dom)
return -EINVAL;
ret = nvkm_object_create(parent, engine, oclass, 0, &ctr); ret = nvkm_object_create(parent, engine, oclass, 0, &ctr);
*pobject = nv_object(ctr); *pobject = nv_object(ctr);
if (ret) if (ret)
...@@ -305,7 +308,6 @@ nvkm_perfctr_ctor(struct nvkm_object *parent, struct nvkm_object *engine, ...@@ -305,7 +308,6 @@ nvkm_perfctr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
ctr->signal[1] = sig[1]; ctr->signal[1] = sig[1];
ctr->signal[2] = sig[2]; ctr->signal[2] = sig[2];
ctr->signal[3] = sig[3]; ctr->signal[3] = sig[3];
if (dom)
list_add_tail(&ctr->head, &dom->list); list_add_tail(&ctr->head, &dom->list);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment