linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/6]] POWERPC: fix memset size error
@ 2007-11-05  2:21 Li Zefan
  2007-11-05  5:35 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2007-11-05  2:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, paulus, LKML


The size passing to memset is wrong.

Signed-off-by Li Zefan <lizf@cn.fujitsu.com>

---
 arch/powerpc/kernel/prom_init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 1db10f7..1add6ef 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1244,7 +1244,7 @@ static void __init prom_initialize_tce_table(void)
 			local_alloc_bottom = base;
 
 		/* It seems OF doesn't null-terminate the path :-( */
-		memset(path, 0, sizeof(path));
+		memset(path, 0, PROM_SCRATCH_SIZE);
 		/* Call OF to setup the TCE hardware */
 		if (call_prom("package-to-path", 3, 1, node,
 			      path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) {
-- 
1.5.3.rc7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/6]] POWERPC: fix memset size error
  2007-11-05  2:21 [PATCH 3/6]] POWERPC: fix memset size error Li Zefan
@ 2007-11-05  5:35 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-05  5:35 UTC (permalink / raw)
  To: Li Zefan; +Cc: linuxppc-dev, Andrew Morton, paulus, LKML


On Mon, 2007-11-05 at 10:21 +0800, Li Zefan wrote:
> The size passing to memset is wrong.
> 
> Signed-off-by Li Zefan <lizf@cn.fujitsu.com>

Good catch, looks like a remain of when path was an array on the stack.

Thanks !

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> 
> ---
>  arch/powerpc/kernel/prom_init.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index 1db10f7..1add6ef 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -1244,7 +1244,7 @@ static void __init prom_initialize_tce_table(void)
>  			local_alloc_bottom = base;
>  
>  		/* It seems OF doesn't null-terminate the path :-( */
> -		memset(path, 0, sizeof(path));
> +		memset(path, 0, PROM_SCRATCH_SIZE);
>  		/* Call OF to setup the TCE hardware */
>  		if (call_prom("package-to-path", 3, 1, node,
>  			      path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-05  5:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-05  2:21 [PATCH 3/6]] POWERPC: fix memset size error Li Zefan
2007-11-05  5:35 ` Benjamin Herrenschmidt

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).