diff options
author | Yinghai Lu <yinghai@kernel.org> | 2013-01-24 21:19:58 +0100 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-01-30 00:26:01 +0100 |
commit | 16a4baa642cf448742aaf150c4daa093f9dbebbb (patch) | |
tree | 108cd2724433574435eff2e7f1d94adc84120859 /arch/x86/boot/cmdline.c | |
parent | x86, boot: Add get_cmd_line_ptr() (diff) | |
download | linux-16a4baa642cf448742aaf150c4daa093f9dbebbb.tar.xz linux-16a4baa642cf448742aaf150c4daa093f9dbebbb.zip |
x86, boot: Move checking of cmd_line_ptr out of common path
cmdline.c::__cmdline_find_option... are shared between 16-bit setup code
and 32/64 bit decompressor code.
for 32/64 only path via kexec, we should not check if ptr is less 1M.
as those cmdline could be put above 1M, or even 4G.
Move out accessible checking out of __cmdline_find_option()
So decompressor in misc.c can parse cmdline correctly.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1359058816-7615-18-git-send-email-yinghai@kernel.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/boot/cmdline.c')
-rw-r--r-- | arch/x86/boot/cmdline.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/boot/cmdline.c b/arch/x86/boot/cmdline.c index 6b3b6f708c04..768f00f32469 100644 --- a/arch/x86/boot/cmdline.c +++ b/arch/x86/boot/cmdline.c @@ -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); @@ -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); |