diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-06-07 10:08:36 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-06-17 18:17:49 +1000 |
commit | f2e52c1b409f6d38ae6241e992d9bcc382588d9f (patch) | |
tree | dbf2caed80e6782fd2076bc9f619be05a540242f /arch | |
parent | ac32e395924d9265e3e36a11ff057ebd40b6ec6f (diff) |
arch/frv/kernel/setup.c: use strncmp() instead of memcmp()
'cmdline' is a NUL terminated string, when its length < 4, memcmp()
will cause memory access out of boundary.
So use strncmp() instead of memcmp().
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/frv/kernel/setup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c index f78f8cb44093..ae3a6706419b 100644 --- a/arch/frv/kernel/setup.c +++ b/arch/frv/kernel/setup.c @@ -735,7 +735,7 @@ static void __init parse_cmdline_early(char *cmdline) /* "mem=XXX[kKmM]" sets SDRAM size to <mem>, overriding the value we worked * out from the SDRAM controller mask register */ - if (!memcmp(cmdline, "mem=", 4)) { + if (!strncmp(cmdline, "mem=", 4)) { unsigned long long mem_size; mem_size = memparse(cmdline + 4, &cmdline); |