]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nouveau/vmm: use kzalloc_flex
authorRosen Penev <rosenp@gmail.com>
Thu, 12 Mar 2026 19:55:29 +0000 (12:55 -0700)
committerLyude Paul <lyude@redhat.com>
Fri, 8 May 2026 18:48:19 +0000 (14:48 -0400)
Use the proper macro do to these sizeof calculations.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
[fixed style warning from checkpatch]
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patch.msgid.link/20260312195529.13002-1-rosenp@gmail.com
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c

index 958fd78080bdbdb3f73808998969312df78de706..107bdb642f22924e19b7ddfe348ef1fcedc6cd38 100644 (file)
@@ -53,7 +53,8 @@ nvkm_vmm_pt_new(const struct nvkm_vmm_desc *desc, bool sparse,
                }
        }
 
-       if (!(pgt = kzalloc(sizeof(*pgt) + (sizeof(pgt->pte[0]) * lpte), GFP_KERNEL)))
+       pgt = kzalloc_flex(*pgt, pte, lpte);
+       if (!pgt)
                return NULL;
        pgt->page = page ? page->shift : 0;
        pgt->sparse = sparse;