drm/nouveau/pmu: do not assume a PMU is present
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 3 Sep 2015 08:39:52 +0000 (17:39 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 3 Nov 2015 05:02:18 +0000 (15:02 +1000)
commit579b7c58215329803ce184704463de09f0f310ac
tree0ee81f66fad2db795dd124201aca12a84e335c22
parent04b8a4bd8e01e25b9fa9fa7b1c957a7346ae83c1
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>
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c