Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356242
b: refs/heads/master
c: 16a4baa
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Jan 29, 2013
1 parent 9c41767 commit 1d5f17a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 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: f1da834cd902f5e5df0b11a3948fc43c6071b590
refs/heads/master: 16a4baa642cf448742aaf150c4daa093f9dbebbb
14 changes: 12 additions & 2 deletions trunk/arch/x86/boot/boot.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,22 @@ int __cmdline_find_option(u32 cmdline_ptr, const char *option, char *buffer, int
int __cmdline_find_option_bool(u32 cmdline_ptr, const char *option);
static inline int cmdline_find_option(const char *option, char *buffer, int bufsize)
{
return __cmdline_find_option(boot_params.hdr.cmd_line_ptr, option, buffer, bufsize);
u32 cmd_line_ptr = boot_params.hdr.cmd_line_ptr;

if (cmd_line_ptr >= 0x100000)
return -1; /* inaccessible */

return __cmdline_find_option(cmd_line_ptr, option, buffer, bufsize);
}

static inline int cmdline_find_option_bool(const char *option)
{
return __cmdline_find_option_bool(boot_params.hdr.cmd_line_ptr, option);
u32 cmd_line_ptr = boot_params.hdr.cmd_line_ptr;

if (cmd_line_ptr >= 0x100000)
return -1; /* inaccessible */

return __cmdline_find_option_bool(cmd_line_ptr, option);
}


Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/x86/boot/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ int __cmdline_find_option(u32 cmdline_ptr, const char *option, char *buffer, int
st_bufcpy /* Copying this to buffer */
} state = st_wordstart;

if (!cmdline_ptr || cmdline_ptr >= 0x100000)
return -1; /* No command line, or inaccessible */
if (!cmdline_ptr)
return -1; /* No command line */

cptr = cmdline_ptr & 0xf;
set_fs(cmdline_ptr >> 4);
Expand Down Expand Up @@ -111,8 +111,8 @@ int __cmdline_find_option_bool(u32 cmdline_ptr, const char *option)
st_wordskip, /* Miscompare, skip */
} state = st_wordstart;

if (!cmdline_ptr || cmdline_ptr >= 0x100000)
return -1; /* No command line, or inaccessible */
if (!cmdline_ptr)
return -1; /* No command line */

cptr = cmdline_ptr & 0xf;
set_fs(cmdline_ptr >> 4);
Expand Down

0 comments on commit 1d5f17a

Please sign in to comment.