Skip to content

Commit

Permalink
drm/nouveau/mmu: qualify vmm during dtor
Browse files Browse the repository at this point in the history
If the BAR initialization failed it may leave the vmm structure in an
unitialized state, leading to a null-pointer-dereference when the vmm is
dereferenced during teardown.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Jon Derrick authored and Ben Skeggs committed May 1, 2019
1 parent 12e08be commit 15516bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ nvkm_vmm_get(struct nvkm_vmm *vmm, u8 page, u64 size, struct nvkm_vma **pvma)
void
nvkm_vmm_part(struct nvkm_vmm *vmm, struct nvkm_memory *inst)
{
if (inst && vmm->func->part) {
if (inst && vmm && vmm->func->part) {
mutex_lock(&vmm->mutex);
vmm->func->part(vmm, inst);
mutex_unlock(&vmm->mutex);
Expand Down

0 comments on commit 15516bf

Please sign in to comment.