diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2015-09-03 17:39:52 +0900 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-10-12 13:08:19 +1000 |
commit | c560c03f570f3622c7771e4bbc402d0f0afb393b (patch) | |
tree | 463d8a08b526142557dddbb43e14a00d26983253 | |
parent | 5df5f6682686c8b45be56f68ca3bde65560560bf (diff) | |
download | nouveau-c560c03f570f3622c7771e4bbc402d0f0afb393b.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); } |