Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755013AbYKQVM0 (ORCPT ); Mon, 17 Nov 2008 16:12:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751749AbYKQVMQ (ORCPT ); Mon, 17 Nov 2008 16:12:16 -0500 Received: from smtp120.sbc.mail.sp1.yahoo.com ([69.147.64.93]:28119 "HELO smtp120.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751468AbYKQVMP (ORCPT ); Mon, 17 Nov 2008 16:12:15 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:Reply-To:To:Subject:Date:User-Agent:Cc:MIME-Version:Content-Disposition:Message-Id:Content-Type:Content-Transfer-Encoding; b=uX2JAOKqsGIP8/x1dPu7A9SreCeqlq+efwYK6PugZT1tMiL39lPsLiQWy+EU8vc1iajgH+jpOh3lHQpaDUifMvSD6tuCI/kMnFQSswHPgFR8qEk8asobDvJ5W4j5eaHdXbza579HymsoexNyM00zWJx9wN0HASwwKHlLo0ggqEc= ; X-YMail-OSG: jBJrFMMVM1mry3IgY6LixHnvqs9bVDb4mweWAuOKxdmeI4X8_NVcr.PlOb66DKZKh31grtPf9hbCpBNfZTJQKSzdW1wMpSNtRqskcPHU7rRlC.lQu.4.xhoGMRzi2XnyZdZg91EKeea4pxfAIVf1Rk_e X-Yahoo-Newman-Property: ymail-3 From: David Brownell Reply-To: dbrownell@users.sourceforge.net To: Linux MTD Subject: [patch 2.6.28-rc5] mtd m25p80: regression fix for chip detection Date: Mon, 17 Nov 2008 11:37:17 -0800 User-Agent: KMail/1.9.10 Cc: lkml , Chen Gong MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200811171137.17431.david-b@pacbell.net> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1310 Lines: 36 From: David Brownell The "m25p80.c extended jedec support" patch introduced a regression whereby every chip ended up matching the first entry in the list of chips, since it parenthesized a test incorrectly. This bug could cause MTD filesystem corruption, and all sorts crazy stuff since all chips would appear to be small (128KB) Atmel chips instead of what they really were. Signed-off-by: David Brownell Cc: Chen Gong --- drivers/mtd/devices/m25p80.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -574,10 +574,11 @@ static struct flash_info *__devinit jede for (tmp = 0, info = m25p_data; tmp < ARRAY_SIZE(m25p_data); tmp++, info++) { - if (info->jedec_id == jedec) + if (info->jedec_id == jedec) { if (ext_jedec != 0 && info->ext_id != ext_jedec) continue; return info; + } } dev_err(&spi->dev, "unrecognized JEDEC id %06x\n", jedec); return NULL; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/