From: Mike Frysinger Date: Thu, 11 Dec 2008 16:32:44 -0500 Subject: [U-Boot] crash when doing `sf probe` multiple times due to API miscommunication In-Reply-To: <200812111552.26376.vapier@gentoo.org> References: <200812111552.26376.vapier@gentoo.org> Message-ID: <200812111632.44908.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday 11 December 2008 15:52:25 Mike Frysinger wrote: > the `sf probe` command does: > static int do_spi_flash_probe(...) > { > ... > new = spi_flash_probe(bus, cs, speed, mode); > if (flash) > spi_flash_free(flash); > flash = new; > ... > } oh, i left out one last function ... void spi_flash_free(struct spi_flash *flash) { spi_free_slave(flash->spi); free(flash); } and we see the wrong "free(flash)" ... maybe if the spi_flash structure provided a pointer to its parent, then we could do "free(flash->parent)" ... -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20081211/38bbef3e/attachment.pgp