Skip to content

Commit d7b6cc1

Browse files
Dan Carpentermpe
authored andcommitted
powerpc/powernv/npu: Allocate enough memory in pnv_try_setup_npu_table_group()
There is a typo so we accidentally allocate enough memory for a pointer when we wanted to allocate enough for a struct. Fixes: 0bd9716 ("powerpc/powernv/npu: Add compound IOMMU groups") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 6529870 commit d7b6cc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/platforms/powernv/npu-dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ struct iommu_table_group *pnv_try_setup_npu_table_group(struct pnv_ioda_pe *pe)
564564
}
565565
} else {
566566
/* Create a group for 1 GPU and attached NPUs for POWER8 */
567-
pe->npucomp = kzalloc(sizeof(pe->npucomp), GFP_KERNEL);
567+
pe->npucomp = kzalloc(sizeof(*pe->npucomp), GFP_KERNEL);
568568
table_group = &pe->npucomp->table_group;
569569
table_group->ops = &pnv_npu_peers_ops;
570570
iommu_register_group(table_group, hose->global_number,

0 commit comments

Comments
 (0)