Skip to content

Commit

Permalink
powerpc/44x: Fix ocm_block allocation
Browse files Browse the repository at this point in the history
Allocate enough memory for the ocm_block structure, not just a pointer
to it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Ilia Mirkin authored and Benjamin Herrenschmidt committed Dec 10, 2013
1 parent 2d6f0c3 commit 1b42983
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/ppc4xx_ocm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1b42983

Please sign in to comment.