mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
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
This commit is contained in:
parent
55e1a59960
commit
c1e854a3e3
|
|
@ -27,6 +27,9 @@
|
|||
void
|
||||
nvif_mmu_dtor(struct nvif_mmu *mmu)
|
||||
{
|
||||
if (!nvif_object_constructed(&mmu->object))
|
||||
return;
|
||||
|
||||
kfree(mmu->kind);
|
||||
kfree(mmu->type);
|
||||
kfree(mmu->heap);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user