linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: mach-omap2: mux: fix buffer overrun
@ 2011-01-05 16:42 Aaro Koskinen
  2011-01-06 22:14 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Aaro Koskinen @ 2011-01-05 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

memcpy() copies 8 bytes too much (omap_mux_entry vs. omap_mux). Correct
by replacing memcpy() with struct assignment, which is safer.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 arch/arm/mach-omap2/mux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 17bd639..df8d2f2 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -893,7 +893,7 @@ static struct omap_mux * __init omap_mux_list_add(
 		return NULL;
 
 	m = &entry->mux;
-	memcpy(m, src, sizeof(struct omap_mux_entry));
+	entry->mux = *src;
 
 #ifdef CONFIG_OMAP_MUX
 	if (omap_mux_copy_names(src, m)) {
-- 
1.5.6.5

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

* [PATCH] arm: mach-omap2: mux: fix buffer overrun
  2011-01-05 16:42 [PATCH] arm: mach-omap2: mux: fix buffer overrun Aaro Koskinen
@ 2011-01-06 22:14 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2011-01-06 22:14 UTC (permalink / raw)
  To: linux-arm-kernel

* Aaro Koskinen <aaro.koskinen@nokia.com> [110105 08:39]:
> memcpy() copies 8 bytes too much (omap_mux_entry vs. omap_mux). Correct
> by replacing memcpy() with struct assignment, which is safer.

Thanks will queue as a fix after the merge window.

Tony
 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
> ---
>  arch/arm/mach-omap2/mux.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
> index 17bd639..df8d2f2 100644
> --- a/arch/arm/mach-omap2/mux.c
> +++ b/arch/arm/mach-omap2/mux.c
> @@ -893,7 +893,7 @@ static struct omap_mux * __init omap_mux_list_add(
>  		return NULL;
>  
>  	m = &entry->mux;
> -	memcpy(m, src, sizeof(struct omap_mux_entry));
> +	entry->mux = *src;
>  
>  #ifdef CONFIG_OMAP_MUX
>  	if (omap_mux_copy_names(src, m)) {
> -- 
> 1.5.6.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2011-01-06 22:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 16:42 [PATCH] arm: mach-omap2: mux: fix buffer overrun Aaro Koskinen
2011-01-06 22:14 ` Tony Lindgren

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