Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117923
b: refs/heads/master
c: 97b0511
h: refs/heads/master
i:
  117921: 39b2e37
  117919: 7d7f68e
v: v3
  • Loading branch information
Geert Uytterhoeven authored and Ralf Baechle committed Oct 27, 2008
1 parent 5d87cd1 commit 086b8f6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d1a8e2a6da5bea09452495748891a4ea9e42035e
refs/heads/master: 97b0511ce125b0cb95d73b198c1bdbb3cebc4de2
22 changes: 18 additions & 4 deletions trunk/arch/mips/txx9/generic/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,23 @@ static struct txx9_board_vec *__init find_board_byname(const char *name)

static void __init prom_init_cmdline(void)
{
int argc = (int)fw_arg0;
int *argv32 = (int *)fw_arg1;
int argc;
int *argv32;
int i; /* Always ignore the "-c" at argv[0] */
char builtin[CL_SIZE];

if (fw_arg0 >= CKSEG0 || fw_arg1 < CKSEG0) {
/*
* argc is not a valid number, or argv32 is not a valid
* pointer
*/
argc = 0;
argv32 = NULL;
} else {
argc = (int)fw_arg0;
argv32 = (int *)fw_arg1;
}

/* ignore all built-in args if any f/w args given */
/*
* But if built-in strings was started with '+', append them
Expand Down Expand Up @@ -414,10 +426,12 @@ char * __init prom_getcmdline(void)

const char *__init prom_getenv(const char *name)
{
const s32 *str = (const s32 *)fw_arg2;
const s32 *str;

if (!str)
if (fw_arg2 < CKSEG0)
return NULL;

str = (const s32 *)fw_arg2;
/* YAMON style ("name", "value" pairs) */
while (str[0] && str[1]) {
if (!strcmp((const char *)(unsigned long)str[0], name))
Expand Down

0 comments on commit 086b8f6

Please sign in to comment.