Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 579b7c58 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Ben Skeggs
Browse files

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: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 04b8a4bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
}