summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2015-09-03 17:39:52 +0900
committerBen Skeggs <bskeggs@redhat.com>2015-10-22 09:11:26 +1000
commitb4a54dbb5ff822af792cbe41d44b951b843dd982 (patch)
tree3a65d2f63694e6e87441475bcfa77888d385b3b0
parent6252ca2b03bb316483810582e0baf537fcdc1ecb (diff)
downloadnouveau-b4a54dbb5ff822af792cbe41d44b951b843dd982.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);
}