diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2018-08-28 00:10:42 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2018-09-06 16:54:28 -0400 |
commit | 51ed833c881b9d96557c773f6a37018d79e29a46 (patch) | |
tree | 4335ce43b696b7bd4340ed1851e9e9157801f659 | |
parent | a43b16dda2d7485f5c5aed075c1dc9785e339515 (diff) |
drm/nouveau/mmu: don't attempt to dereference vmm without valid instance pointer
Fixes oopses in certain failure paths.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c index de269eb482dd..7459def78d50 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | |||
@@ -1423,7 +1423,7 @@ nvkm_vmm_get(struct nvkm_vmm *vmm, u8 page, u64 size, struct nvkm_vma **pvma) | |||
1423 | void | 1423 | void |
1424 | nvkm_vmm_part(struct nvkm_vmm *vmm, struct nvkm_memory *inst) | 1424 | nvkm_vmm_part(struct nvkm_vmm *vmm, struct nvkm_memory *inst) |
1425 | { | 1425 | { |
1426 | if (vmm->func->part && inst) { | 1426 | if (inst && vmm->func->part) { |
1427 | mutex_lock(&vmm->mutex); | 1427 | mutex_lock(&vmm->mutex); |
1428 | vmm->func->part(vmm, inst); | 1428 | vmm->func->part(vmm, inst); |
1429 | mutex_unlock(&vmm->mutex); | 1429 | mutex_unlock(&vmm->mutex); |