Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: "Steven J. Hill" <sjhill@mips.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH 06/35] MIPS: ath79: Cleanup firmware support for the ath79 platform.
Date: Wed, 06 Jun 2012 15:04:37 +0200	[thread overview]
Message-ID: <4FCF5565.2040909@openwrt.org> (raw)
In-Reply-To: <1338931179-9611-7-git-send-email-sjhill@mips.com>

Hi Steven,

2012.06.05. 23:19 keltezéssel, Steven J. Hill írta:
> From: "Steven J. Hill" <sjhill@mips.com>
> 
> Signed-off-by: Steven J. Hill <sjhill@mips.com>
> ---
>  arch/mips/ath79/prom.c |   20 ++++----------------
>  1 file changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/mips/ath79/prom.c b/arch/mips/ath79/prom.c
> index e9cbd7c..adbe614 100644
> --- a/arch/mips/ath79/prom.c
> +++ b/arch/mips/ath79/prom.c
> @@ -14,7 +14,7 @@
>  #include <linux/io.h>
>  #include <linux/string.h>
>  
> -#include <asm/bootinfo.h>
> +#include <asm/fw/fw.h>
>  #include <asm/addrspace.h>
>  
>  #include "common.h"
> @@ -32,23 +32,11 @@ static inline int is_valid_ram_addr(void *addr)
>  	return 0;
>  }
>  
> -static __init void ath79_prom_init_cmdline(int argc, char **argv)
> -{
> -	int i;
> -
> -	if (!is_valid_ram_addr(argv))
> -		return;
> -
> -	for (i = 0; i < argc; i++)
> -		if (is_valid_ram_addr(argv[i])) {

Please don't remove this validation. The Atheros AR7xxx/AR9xxx based boards are
using various bootloaders. Some of them puts insane values in argv, and this
validation ensures that the kernel will not crash with them.

> -			strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
> -			strlcat(arcs_cmdline, argv[i], sizeof(arcs_cmdline));
> -		}
> -}
> -
>  void __init prom_init(void)
>  {
> -	ath79_prom_init_cmdline(fw_arg0, (char **)fw_arg1);
> +	if (!is_valid_ram_addr((int *)fw_arg1))

The 'is_valid_ram_addr' function requires a 'void *' argument, so it would be
more precise to use that instead of 'int *' in the cast.

> +		return;
> +	fw_init_cmdline();
>  }
>  
>  void __init prom_free_prom_memory(void)

-Gabor

  reply	other threads:[~2012-06-06 13:04 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05 21:19 [PATCH 00/35] Cleanup firmware support across multiple platforms Steven J. Hill
2012-06-05 21:19 ` [PATCH 01/35] MIPS: Add environment variable processing code to firmware library Steven J. Hill
2012-06-05 21:19 ` [PATCH 02/35] MIPS: Alchemy: Cleanup firmware support for Alchemy platforms Steven J. Hill
2012-06-05 21:19 ` [PATCH 03/35] MIPS: Alchemy: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 04/35] MIPS: AR7: Cleanup firmware support for the AR7 platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 05/35] MIPS: AR7: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 06/35] MIPS: ath79: Cleanup firmware support for the ath79 platform Steven J. Hill
2012-06-06 13:04   ` Gabor Juhos [this message]
2012-06-05 21:19 ` [PATCH 07/35] MIPS: ath79: Cleanup files effected by firmware changes Steven J. Hill
2012-06-06 11:16   ` Sergei Shtylyov
2012-06-05 21:19 ` [PATCH 08/35] MIPS: Cobalt: Cleanup firmware support for the Cobalt platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 09/35] MIPS: Cobalt: Cleanup files effected by firmware changes Steven J. Hill
2012-06-06  2:09   ` Yuasa Yoichi
2012-06-06  2:22     ` Hill, Steven
2012-06-05 21:19 ` [PATCH 10/35] MIPS: Emma: Cleanup firmware support for the Emma platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 11/35] MIPS: Emma: Cleanup files effected by firmware changes Steven J. Hill
2012-06-06 11:29   ` Sergei Shtylyov
2012-06-05 21:19 ` [PATCH 12/35] MIPS: jz4740: Cleanup firmware support for the JZ4740 platform Steven J. Hill
2012-06-06 12:13   ` Lars-Peter Clausen
2012-06-05 21:19 ` [PATCH 13/35] MIPS: jz4740: Cleanup files effected by firmware changes Steven J. Hill
2012-06-06 11:38   ` Sergei Shtylyov
2012-06-06 12:18   ` Lars-Peter Clausen
2012-06-05 21:19 ` [PATCH 14/35] MIPS: lantiq: Cleanup firmware support for the lantiq platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 15/35] MIPS: lantiq: Cleanup files effected by firmware changes Steven J. Hill
2012-06-06  5:38   ` John Crispin
2012-06-05 21:19 ` [PATCH 16/35] MIPS: Lasat: Cleanup firmware support for the Lasat platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 17/35] MIPS: Lasat: Cleanup files effected by firmware changes Steven J. Hill
2012-06-06 11:54   ` Sergei Shtylyov
2012-06-05 21:19 ` [PATCH 18/35] MIPS: Loongson: Cleanup firmware support for the Loongson platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 19/35] MIPS: Loongson: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 20/35] MIPS: Malta: Cleanup firmware support for the Malta platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 21/35] MIPS: Malta: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 22/35] MIPS: Netlogic: Cleanup firmware support for the XLR platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 23/35] MIPS: Netlogic: Cleanup files effected by firmware changes Steven J. Hill
2012-06-06  8:42   ` Jayachandran C.
2012-06-06 12:00   ` Sergei Shtylyov
2012-06-05 21:19 ` [PATCH 24/35] MIPS: MSP71xx, Yosemite: Cleanup firmware support for PMC platforms Steven J. Hill
2012-06-05 21:19 ` [PATCH 25/35] MIPS: MSP71xx, Yosemite: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 26/35] MIPS: PNX83xx, PNX8550: Cleanup firmware support for PNX platforms Steven J. Hill
2012-06-05 21:19 ` [PATCH 27/35] MIPS: PNX83xx, PNX8550: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 28/35] MIPS: PowerTV: Cleanup firmware support for PowerTV platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 29/35] MIPS: PowerTV: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 30/35] MIPS: RB532: Cleanup firmware support for RB532 platform Steven J. Hill
2012-06-05 21:19 ` [PATCH 31/35] MIPS: RB532: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 32/35] MIPS: txx9: Cleanup firmware support for txx9 platforms Steven J. Hill
2012-06-06 13:27   ` Geert Uytterhoeven
2012-06-05 21:19 ` [PATCH 33/35] MIPS: txx9: Cleanup files effected by firmware changes Steven J. Hill
2012-06-05 21:19 ` [PATCH 34/35] MIPS: vr41xx: Cleanup firmware support for vr41xx platforms Steven J. Hill
2012-06-06  2:20   ` Yuasa Yoichi
2012-06-06  2:27     ` Hill, Steven
2012-06-06  2:36       ` Yuasa Yoichi
2012-06-05 21:19 ` [PATCH 35/35] MIPS: vr41xx: Cleanup files effected by firmware changes Steven J. Hill
2012-06-06  2:14   ` Yuasa Yoichi
2012-06-06  2:18     ` Hill, Steven
2012-06-06  2:33       ` Yuasa Yoichi
2012-06-06 12:16 ` [PATCH 00/35] Cleanup firmware support across multiple platforms Florian Fainelli
2012-06-07 14:46 ` Steven J. Hill

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=4FCF5565.2040909@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=sjhill@mips.com \
    /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