]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/nouveau/mmu: don't attempt to dereference vmm without valid instance pointer
authorBen Skeggs <bskeggs@redhat.com>
Tue, 28 Aug 2018 04:10:42 +0000 (14:10 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 6 Sep 2018 20:54:28 +0000 (06:54 +1000)
Fixes oopses in certain failure paths.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c

index de269eb482dd03cc7c2fd8b5a707d1566b1360e5..7459def78d504f006a2f7f0b625ba3372238b7ec 100644 (file)
@@ -1423,7 +1423,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 (vmm->func->part && inst) {
+       if (inst && vmm->func->part) {
                mutex_lock(&vmm->mutex);
                vmm->func->part(vmm, inst);
                mutex_unlock(&vmm->mutex);