X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/95c0a2e2269d18875aa1f1805fb1229f901aa790..1d55b67ff96d3a1a9bb786ec78250134d4ab5c81:/target/linux/brcm63xx/files/drivers/mtd/maps/bcm963xx-flash.c diff --git a/target/linux/brcm63xx/files/drivers/mtd/maps/bcm963xx-flash.c b/target/linux/brcm63xx/files/drivers/mtd/maps/bcm963xx-flash.c index 504dfac84..9543c172a 100644 --- a/target/linux/brcm63xx/files/drivers/mtd/maps/bcm963xx-flash.c +++ b/target/linux/brcm63xx/files/drivers/mtd/maps/bcm963xx-flash.c @@ -177,13 +177,14 @@ static int bcm963xx_detect_cfe(struct mtd_info *master) { int idoffset = 0x4e0; static char idstring[8] = "CFE1CFE1"; - char buf[8]; + char buf[9]; int ret; size_t retlen; ret = master->read(master, idoffset, 8, &retlen, (void *)buf); + buf[retlen] = 0; printk("bcm963xx: Read Signature value of %s\n", buf); - return strcmp(idstring,buf); + return strncmp(idstring,buf,8); } static int __init bcm963xx_mtd_init(void)