From c07bd8617579bb7f1379b10f3e9a37eaa1839049 Mon Sep 17 00:00:00 2001
From: Imre Kaloz <kaloz@openwrt.org>
Date: Sun, 31 Jan 2010 13:46:52 +0000
Subject: [PATCH] fixup cambria/avila model detection

SVN-Revision: 19448
---
 target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch | 4 ++--
 target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch b/target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch
index 2ec8b5e444d..6753451bed5 100644
--- a/target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch
+++ b/target/linux/ixp4xx/patches-2.6.32/190-cambria_support.patch
@@ -398,6 +398,7 @@
 +static struct cambria_board_info * __init cambria_find_board_info(char *model)
 +{
 +	int i;
++	model[6] = '\0';
 +
 +	for (i = 0; i < ARRAY_SIZE(cambria_boards); i++) {
 +		struct cambria_board_info *info = &cambria_boards[i];
@@ -413,7 +414,7 @@
 +static void at24_setup(struct memory_accessor *mem_acc, void *context)
 +{
 +	char mac_addr[ETH_ALEN];
-+	char model[6];
++	char model[7];
 +
 +	at24_mem_acc = mem_acc;
 +
@@ -421,7 +422,6 @@
 +	if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x0, 6) == 6) {
 +		memcpy(&cambria_npec_data.hwaddr, mac_addr, ETH_ALEN);
 +	}
-+
 +	if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x6, 6) == 6) {
 +		memcpy(&cambria_npea_data.hwaddr, mac_addr, ETH_ALEN);
 +	}
diff --git a/target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch b/target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch
index c298834275e..d3ccb045c8c 100644
--- a/target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch
+++ b/target/linux/ixp4xx/patches-2.6.32/300-avila_fetch_mac.patch
@@ -147,6 +147,7 @@
 +static struct avila_board_info * __init avila_find_board_info(char *model)
 +{
 +	int i;
++	model[6] = '\0';
 +
 +	for (i = 0; i < ARRAY_SIZE(avila_boards); i++) {
 +		struct avila_board_info *info = &avila_boards[i];
@@ -162,7 +163,7 @@
 +static void at24_setup(struct memory_accessor *mem_acc, void *context)
 +{
 +	char mac_addr[ETH_ALEN];
-+	char model[6];
++	char model[7];
 +
 +	at24_mem_acc = mem_acc;
 +
@@ -170,7 +171,6 @@
 +	if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x0, 6) == 6) {
 +		memcpy(&avila_npeb_data.hwaddr, mac_addr, ETH_ALEN);
 +	}
-+
 +	if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x6, 6) == 6) {
 +		memcpy(&avila_npec_data.hwaddr, mac_addr, ETH_ALEN);
 +	}