
11 Dec
2008
11 Dec
'08
10:32 p.m.
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