提交 1b429835 编写于 作者: I Ilia Mirkin 提交者: Benjamin Herrenschmidt

powerpc/44x: Fix ocm_block allocation

Allocate enough memory for the ocm_block structure, not just a pointer
to it.
Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 2d6f0c3a
...@@ -339,7 +339,7 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align, ...@@ -339,7 +339,7 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align,
if (IS_ERR_VALUE(offset)) if (IS_ERR_VALUE(offset))
continue; continue;
ocm_blk = kzalloc(sizeof(struct ocm_block *), GFP_KERNEL); ocm_blk = kzalloc(sizeof(struct ocm_block), GFP_KERNEL);
if (!ocm_blk) { if (!ocm_blk) {
printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block"); printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block");
rh_free(ocm_reg->rh, offset); rh_free(ocm_reg->rh, offset);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册