aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/loongson/common/machtype.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2011-03-23 02:33:54 -0400
committerLen Brown <len.brown@intel.com>2011-03-23 02:33:54 -0400
commit5c129a8600100a5d0f5fdbc1014c5dba1d307bc4 (patch)
tree9877a14b49cff43d0ba10c12f407ec551c77daa5 /arch/mips/loongson/common/machtype.c
parent797b10a07069e153d41aedb4ae8e76660279e2ee (diff)
parent521cb40b0c44418a4fd36dc633f575813d59a43d (diff)
Merge commit 'v2.6.38' into release
Diffstat (limited to 'arch/mips/loongson/common/machtype.c')
-rw-r--r--arch/mips/loongson/common/machtype.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/loongson/common/machtype.c b/arch/mips/loongson/common/machtype.c
index 81fbe6b73f9..2efd5d9dee2 100644
--- a/arch/mips/loongson/common/machtype.c
+++ b/arch/mips/loongson/common/machtype.c
@@ -41,7 +41,7 @@ void __weak __init mach_prom_init_machtype(void)
void __init prom_init_machtype(void)
{
- char *p, str[MACHTYPE_LEN];
+ char *p, str[MACHTYPE_LEN + 1];
int machtype = MACH_LEMOTE_FL2E;
mips_machtype = LOONGSON_MACHTYPE;
@@ -53,6 +53,7 @@ void __init prom_init_machtype(void)
}
p += strlen("machtype=");
strncpy(str, p, MACHTYPE_LEN);
+ str[MACHTYPE_LEN] = '\0';
p = strstr(str, " ");
if (p)
*p = '\0';