nouveau/vmm: use kzalloc_flex

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
This commit is contained in:
Rosen Penev 2026-03-12 12:55:29 -07:00 committed by Lyude Paul
parent 50e13e0edb
commit cf0ba1ad14

View 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;