diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2015-09-03 17:39:52 +0900 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-09-11 11:29:41 +1000 |
commit | ef7a427609a8c19204d9298d5735a0a3de33bcea (patch) | |
tree | 41ab5b26a7a01533e016269b7c5ef686df2fa401 | |
parent | 37ad451418b5e53ddfe7143c16c20322972a3442 (diff) | |
download | nouveau-ef7a427609a8c19204d9298d5735a0a3de33bcea.tar.gz |
pmu: do not assume a PMU is present
Some devices may not have a PMU. Avoid a NULL pointer dereference in
such cases by checking whether the pointer given to nvkm_pmu_pgob() is
valid.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drm/nouveau/nvkm/subdev/pmu/base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drm/nouveau/nvkm/subdev/pmu/base.c b/drm/nouveau/nvkm/subdev/pmu/base.c index 27a79c0c3..d95eb8659 100644 --- a/drm/nouveau/nvkm/subdev/pmu/base.c +++ b/drm/nouveau/nvkm/subdev/pmu/base.c @@ -28,7 +28,7 @@ void nvkm_pmu_pgob(struct nvkm_pmu *pmu, bool enable) { - if (pmu->func->pgob) + if (pmu && pmu->func->pgob) pmu->func->pgob(pmu, enable); } |