提交 579b7c58 编写于 作者: A Alexandre Courbot 提交者: Ben Skeggs

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: NAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 04b8a4bd
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
void void
nvkm_pmu_pgob(struct nvkm_pmu *pmu, bool enable) nvkm_pmu_pgob(struct nvkm_pmu *pmu, bool enable)
{ {
if (pmu->func->pgob) if (pmu && pmu->func->pgob)
pmu->func->pgob(pmu, enable); pmu->func->pgob(pmu, enable);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册