Commit 233ffe57 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Greg Kroah-Hartman

drm/nouveau/pmu: do not assume a PMU is present

commit 579b7c58 upstream.

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: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fee906f0
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment