1 From f1a605c36cf1659f5f486ae4135de1e285fdf86c Mon Sep 17 00:00:00 2001
2 From: Axel Gembe <ago@bastart.eu.org>
3 Date: Sat, 17 May 2008 16:17:22 +0200
4 Subject: [PATCH] bcm963xx: fix cfe detection
6 The CFE detection failed to account for zero termination.
8 Signed-off-by: Axel Gembe <ago@bastart.eu.org>
10 drivers/mtd/maps/bcm963xx-flash.c | 11 ++++++-----
11 1 files changed, 6 insertions(+), 5 deletions(-)
13 --- a/drivers/mtd/maps/bcm963xx-flash.c
14 +++ b/drivers/mtd/maps/bcm963xx-flash.c
18 * Copyright (C) 2006 Florian Fainelli <florian@openwrt.org>
19 - * Mike Albon <malbon@openwrt.org>
20 - * Copyright (C) $Date$ $Author$
21 + * Mike Albon <malbon@openwrt.org>
22 + * Copyright (C) 2008 Axel Gembe <ago@bastart.eu.org>
24 * This program is free software; you can redistribute it and/or modify
25 * it under the terms of the GNU General Public License as published by
27 static int bcm963xx_detect_cfe(struct mtd_info *master)
30 - static char idstring[8] = "CFE1CFE1";
32 + static char idstring[9] = "CFE1CFE1";
37 + memset(buf, 0, sizeof(buf));
39 ret = master->read(master, idoffset, 8, &retlen, (void *)buf);
40 printk("bcm963xx: Read Signature value of %s\n", buf);
41 return strcmp(idstring,buf);