From: Vinh Huu Tuong Nguyen <vhtnguyen@apm.com>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/44x: fix ocm_block allocation
Date: Mon, 9 Dec 2013 15:38:23 +0700 [thread overview]
Message-ID: <CAM9eBokeHwgDnddrH5PVNK9bCT7b1_7GA98DsJaUwKPJfLCvgw@mail.gmail.com> (raw)
In-Reply-To: <1386377017-909-1-git-send-email-imirkin@alum.mit.edu>
[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]
Hi Ilia Mirkin,
Thanks for your info. I did investigated why our test didn't detect it and
found out that the struct ocm_block is only used on ocm_debugfs_show
function when we want to know information about ocm and it's available when
we enable debugfs. But our test only tried to use the OCM block functions
and didn't care about the OCM information. So I think we should apply your
patch to solve this issue instead of removing ocm part.
On Sat, Dec 7, 2013 at 7:43 AM, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> Allocate enough memory for the ocm_block structure, not just a pointer
> to it.
>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> ---
>
> I have neither the hardware to test nor the toolchain to even build-test
> this. However this seems like a fairly obvious fix (and I have to wonder
> how
> this ever worked at all). Found with spatch.
>
> Actually further investigation makes it seem like this function is never
> called, perhaps it should just be removed? If it is kept around though,
> would
> be nice to apply this patch so that tools don't trip over this wrong code.
>
> arch/powerpc/sysdev/ppc4xx_ocm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/sysdev/ppc4xx_ocm.c
> b/arch/powerpc/sysdev/ppc4xx_ocm.c
> index b7c4345..85d9e37 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);
> --
> 1.8.3.2
>
>
--
*Vinh Nguyen Huu Tuong **|** Staff SW Engineer*
C: 090.335.7841 | O: 083.770.0640 ext: 3719
F: 083.770.0641 | vhtnguyen@apm.com
[-- Attachment #2: Type: text/html, Size: 4295 bytes --]
next prev parent reply other threads:[~2013-12-09 8:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-07 0:43 [PATCH] powerpc/44x: fix ocm_block allocation Ilia Mirkin
2013-12-09 8:38 ` Vinh Huu Tuong Nguyen [this message]
2013-12-09 15:28 ` Ilia Mirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAM9eBokeHwgDnddrH5PVNK9bCT7b1_7GA98DsJaUwKPJfLCvgw@mail.gmail.com \
--to=vhtnguyen@apm.com \
--cc=imirkin@alum.mit.edu \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).