linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv/npu: Allocate enough memory in pnv_try_setup_npu_table_group()
@ 2019-01-09 10:23 Dan Carpenter
  2019-01-09 11:54 ` Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dan Carpenter @ 2019-01-09 10:23 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Alexey Kardashevskiy
  Cc: Alexey Kardashevskiy, Mark Hairgrove, kernel-janitors,
	Paul Mackerras, Alistair Popple, linuxppc-dev

There is a typo so we accidentally allocate enough memory for a pointer
when we wanted to allocate enough for a struct.

Fixes: 0bd971676e68 ("powerpc/powernv/npu: Add compound IOMMU groups")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 arch/powerpc/platforms/powernv/npu-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
index d7f742ed48ba..3f58c7dbd581 100644
--- a/arch/powerpc/platforms/powernv/npu-dma.c
+++ b/arch/powerpc/platforms/powernv/npu-dma.c
@@ -564,7 +564,7 @@ struct iommu_table_group *pnv_try_setup_npu_table_group(struct pnv_ioda_pe *pe)
 		}
 	} else {
 		/* 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->ops = &pnv_npu_peers_ops;
 		iommu_register_group(table_group, hose->global_number,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-14 10:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 10:23 [PATCH] powerpc/powernv/npu: Allocate enough memory in pnv_try_setup_npu_table_group() Dan Carpenter
2019-01-09 11:54 ` Michael Ellerman
2019-01-11  2:12   ` Alexey Kardashevskiy
2019-01-12  0:30 ` Balbir Singh
2019-01-12  5:44   ` Dan Carpenter
2019-01-12  7:34     ` Segher Boessenkool
2019-01-12 10:51       ` Dan Carpenter
2019-01-14 10:12 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).