summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2015-09-03 17:39:52 +0900
committerBen Skeggs <bskeggs@redhat.com>2015-09-11 11:29:41 +1000
commitef7a427609a8c19204d9298d5735a0a3de33bcea (patch)
tree41ab5b26a7a01533e016269b7c5ef686df2fa401
parent37ad451418b5e53ddfe7143c16c20322972a3442 (diff)
downloadnouveau-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.c2
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);
}