diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-07-03 18:04:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:41 -0400 |
commit | 98bd8d05ea5798ff3179ee33f0ca2789722ecc5a (patch) | |
tree | 370a982aa598bdf50f31ab0f3b3cccba62143ddc /arch/frv | |
parent | 760033c45e8aa13c9e02530da7274edc624c7689 (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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/frv')
-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) | |||
735 | /* "mem=XXX[kKmM]" sets SDRAM size to <mem>, overriding the value we worked | 735 | /* "mem=XXX[kKmM]" sets SDRAM size to <mem>, overriding the value we worked |
736 | * out from the SDRAM controller mask register | 736 | * out from the SDRAM controller mask register |
737 | */ | 737 | */ |
738 | if (!memcmp(cmdline, "mem=", 4)) { | 738 | if (!strncmp(cmdline, "mem=", 4)) { |
739 | unsigned long long mem_size; | 739 | unsigned long long mem_size; |
740 | 740 | ||
741 | mem_size = memparse(cmdline + 4, &cmdline); | 741 | mem_size = memparse(cmdline + 4, &cmdline); |