drm/nouveau/nvif: fix potential double-free
authorBen Skeggs <bskeggs@redhat.com>
Thu, 25 May 2023 00:31:05 +0000 (10:31 +1000)
committerKarol Herbst <kherbst@redhat.com>
Thu, 6 Jul 2023 15:22:33 +0000 (17:22 +0200)
commitc1e854a3e3fda82a0bf567c2f00bfc4f9b0fb147
treeb421d4d118f4e85345c32a01822f925ee2e71af5
parent55e1a5996085513aa2a484ff643ac2bc4b1ff5d6
drm/nouveau/nvif: fix potential double-free

DRM cleanup paths unconditionally call nvif_mmu_dtor() for clients,
which would result in a double-free if nvif_mmu_ctor()'d previously
failed.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-9-skeggsb@gmail.com
drivers/gpu/drm/nouveau/nvif/mmu.c