Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <imirkin@alum.mit.edu>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Ilia Mirkin and committed by
Benjamin Herrenschmidt
1b429835 2d6f0c3a

+1 -1
+1 -1
arch/powerpc/sysdev/ppc4xx_ocm.c
··· 339 339 if (IS_ERR_VALUE(offset)) 340 340 continue; 341 341 342 - ocm_blk = kzalloc(sizeof(struct ocm_block *), GFP_KERNEL); 342 + ocm_blk = kzalloc(sizeof(struct ocm_block), GFP_KERNEL); 343 343 if (!ocm_blk) { 344 344 printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block"); 345 345 rh_free(ocm_reg->rh, offset);