diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2018-08-28 06:10:42 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2018-09-06 22:54:28 +0200 |
commit | 51ed833c881b9d96557c773f6a37018d79e29a46 (patch) | |
tree | 4335ce43b696b7bd4340ed1851e9e9157801f659 | |
parent | drm/nouveau: fix oops in client init failure path (diff) | |
download | linux-51ed833c881b9d96557c773f6a37018d79e29a46.tar.xz linux-51ed833c881b9d96557c773f6a37018d79e29a46.zip |
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) 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); |