1
0
Fork 0

drm/nouveau/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>
hifive-unleashed-5.1
Alexandre Courbot 2015-09-03 17:39:52 +09:00 committed by Ben Skeggs
parent 04b8a4bd8e
commit 579b7c5821
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}