From: Ilia Mirkin Date: Sat, 7 Dec 2013 00:43:37 +0000 (-0500) Subject: powerpc/44x: Fix ocm_block allocation X-Git-Tag: v3.13-rc4~38^2~7 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=1b429835be7ce514b36b551e785d425fd56cd1f2;p=linux.git powerpc/44x: Fix ocm_block allocation Allocate enough memory for the ocm_block structure, not just a pointer to it. Signed-off-by: Ilia Mirkin Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/sysdev/ppc4xx_ocm.c b/arch/powerpc/sysdev/ppc4xx_ocm.c index b7c43453236d..85d9e37f5ccb 100644 --- a/arch/powerpc/sysdev/ppc4xx_ocm.c +++ b/arch/powerpc/sysdev/ppc4xx_ocm.c @@ -339,7 +339,7 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align, if (IS_ERR_VALUE(offset)) continue; - ocm_blk = kzalloc(sizeof(struct ocm_block *), GFP_KERNEL); + ocm_blk = kzalloc(sizeof(struct ocm_block), GFP_KERNEL); if (!ocm_blk) { printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block"); rh_free(ocm_reg->rh, offset);