Commit d7b6cc19 authored by Dan Carpenter's avatar Dan Carpenter Committed by Michael Ellerman
Browse files

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: 0bd97167 ("powerpc/powernv/npu: Add compound IOMMU groups")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 6529870c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -564,7 +564,7 @@ struct iommu_table_group *pnv_try_setup_npu_table_group(struct pnv_ioda_pe *pe)
		}
		}
	} else {
	} else {
		/* Create a group for 1 GPU and attached NPUs for POWER8 */
		/* Create a group for 1 GPU and attached NPUs for POWER8 */
		pe->npucomp = kzalloc(sizeof(pe->npucomp), GFP_KERNEL);
		pe->npucomp = kzalloc(sizeof(*pe->npucomp), GFP_KERNEL);
		table_group = &pe->npucomp->table_group;
		table_group = &pe->npucomp->table_group;
		table_group->ops = &pnv_npu_peers_ops;
		table_group->ops = &pnv_npu_peers_ops;
		iommu_register_group(table_group, hose->global_number,
		iommu_register_group(table_group, hose->global_number,