diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2015-06-07 23:40:16 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 05:39:58 +0300 |
commit | 44d9de58ea5633e4f2d062e718016383b28b4eed (patch) | |
tree | 71929d2d1f33eb8c7f496acee0b3be482b5fdd9a /drivers/gpu/drm/nouveau | |
parent | 5a0bc4b5aeba3bb32eb7da6a98108e93bbd64f7e (diff) | |
download | linux-44d9de58ea5633e4f2d062e718016383b28b4eed.tar.xz |
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: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c index cb88170610bb..2f851473cecf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c @@ -294,6 +294,9 @@ nvkm_perfctr_ctor(struct nvkm_object *parent, struct nvkm_object *engine, return -EINVAL; } + if (!dom) + return -EINVAL; + ret = nvkm_object_create(parent, engine, oclass, 0, &ctr); *pobject = nv_object(ctr); if (ret) @@ -305,8 +308,7 @@ nvkm_perfctr_ctor(struct nvkm_object *parent, struct nvkm_object *engine, ctr->signal[1] = sig[1]; ctr->signal[2] = sig[2]; ctr->signal[3] = sig[3]; - if (dom) - list_add_tail(&ctr->head, &dom->list); + list_add_tail(&ctr->head, &dom->list); return 0; } |