* [PATCH RESEND 0/4] m25p80 enhance patches
@ 2008-08-07 3:41 Chen Gong
[not found] ` <1218080495-2653-2-git-send-email-g.chen@freescale.com>
0 siblings, 1 reply; 4+ messages in thread
From: Chen Gong @ 2008-08-07 3:41 UTC (permalink / raw)
To: linux-mtd; +Cc: dwmw2
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <1218080495-2653-2-git-send-email-g.chen@freescale.com>]
[parent not found: <1218080495-2653-3-git-send-email-g.chen@freescale.com>]
[parent not found: <1218080495-2653-4-git-send-email-g.chen@freescale.com>]
* Re: [PATCH 3/3] [MTD] m25p80.c [not found] ` <1218080495-2653-4-git-send-email-g.chen@freescale.com> @ 2008-08-07 13:31 ` David Woodhouse 2008-09-15 7:06 ` David Woodhouse 1 sibling, 0 replies; 4+ messages in thread From: David Woodhouse @ 2008-08-07 13:31 UTC (permalink / raw) To: Chen Gong; +Cc: linux-mtd On Thu, 2008-08-07 at 11:41 +0800, Chen Gong wrote: > Signed-off-by: Chen Gong <g.chen@freescale.com> Changelog entry for this one? -- dwmw2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] [MTD] m25p80.c [not found] ` <1218080495-2653-4-git-send-email-g.chen@freescale.com> 2008-08-07 13:31 ` [PATCH 3/3] [MTD] m25p80.c David Woodhouse @ 2008-09-15 7:06 ` David Woodhouse 2008-09-16 3:50 ` chen gong 1 sibling, 1 reply; 4+ messages in thread From: David Woodhouse @ 2008-09-15 7:06 UTC (permalink / raw) To: Chen Gong; +Cc: linux-mtd, viro On Thu, 2008-08-07 at 11:41 +0800, Chen Gong wrote: > @@ -547,6 +550,7 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi) > u8 code = OPCODE_RDID; > u8 id[3]; > u32 jedec; > + u16 ext_jedec; > struct flash_info *info; > > /* JEDEC also defines an optional "extended device information" * string for after vendor-specific data, after the three bytes * we use here. Supporting some chips might require using it. */ tmp = spi_write_then_read(spi, &code, 1, id, 3); if (tmp < 0) { DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", spi->dev.bus_id, tmp); return NULL; } jedec = id[0]; jedec = jedec << 8; jedec |= id[1]; > jedec = jedec << 8; > jedec |= id[2]; > > + ext_jedec = id[3] << 8 | id[4]; > + You're trying to read off the end of the id[] array, which has only three elements. And you didn't ask spi_write_then_read() to read that many bytes _anyway_. And if you did... would it fail on chips which don't have the extended device information? Please test and send a fix, since this is already in the git tree. -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] [MTD] m25p80.c 2008-09-15 7:06 ` David Woodhouse @ 2008-09-16 3:50 ` chen gong 0 siblings, 0 replies; 4+ messages in thread From: chen gong @ 2008-09-16 3:50 UTC (permalink / raw) To: David Woodhouse; +Cc: linux-mtd, viro 2008/9/15 David Woodhouse <dwmw2@infradead.org>: > On Thu, 2008-08-07 at 11:41 +0800, Chen Gong wrote: >> @@ -547,6 +550,7 @@ static struct flash_info *__devinit jedec_probe(struct spi_device *spi) >> u8 code = OPCODE_RDID; >> u8 id[3]; >> u32 jedec; >> + u16 ext_jedec; >> struct flash_info *info; >> >> /* JEDEC also defines an optional "extended device information" > * string for after vendor-specific data, after the three bytes > * we use here. Supporting some chips might require using it. > */ > tmp = spi_write_then_read(spi, &code, 1, id, 3); > if (tmp < 0) { > DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", > spi->dev.bus_id, tmp); > return NULL; > } > jedec = id[0]; > jedec = jedec << 8; > jedec |= id[1]; >> jedec = jedec << 8; >> jedec |= id[2]; >> >> + ext_jedec = id[3] << 8 | id[4]; >> + > > You're trying to read off the end of the id[] array, which has only > three elements. And you didn't ask spi_write_then_read() to read that > many bytes _anyway_. And if you did... would it fail on chips which > don't have the extended device information? > Sorry for late. Last day is Mid-autumn Festival in our Country. We have a nice holiday. It is a stupid error that I forget to fix it from my branch. I will send a new patch to fix it soon. > Please test and send a fix, since this is already in the git tree. > > -- > David Woodhouse Open Source Technology Centre > David.Woodhouse@intel.com Intel Corporation > > > ______________________________________________________ > Linux MTD discussion mailing list > http://lists.infradead.org/mailman/listinfo/linux-mtd/ > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-09-16 4:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-07 3:41 [PATCH RESEND 0/4] m25p80 enhance patches Chen Gong
[not found] ` <1218080495-2653-2-git-send-email-g.chen@freescale.com>
[not found] ` <1218080495-2653-3-git-send-email-g.chen@freescale.com>
[not found] ` <1218080495-2653-4-git-send-email-g.chen@freescale.com>
2008-08-07 13:31 ` [PATCH 3/3] [MTD] m25p80.c David Woodhouse
2008-09-15 7:06 ` David Woodhouse
2008-09-16 3:50 ` chen gong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox