[U-Boot] [PATCH 14/16] sandbox: spi: Remove an incorrect free()

Simon Glass sjg at chromium.org
Mon Feb 15 02:36:58 CET 2016


We must not free data that is managed by driver mode. Remove this line,
which is a hangover from the pre-driver-model code.

This fixes a problem where 'sf probe' crashes U-Boot if the backing file
for the SPI flash cannot be found.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/mtd/spi/sandbox.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
index ec07be7..53470b9 100644
--- a/drivers/mtd/spi/sandbox.c
+++ b/drivers/mtd/spi/sandbox.c
@@ -187,7 +187,6 @@ static int sandbox_sf_probe(struct udevice *dev)
 
 	sbsf->fd = os_open(pdata->filename, 02);
 	if (sbsf->fd == -1) {
-		free(sbsf);
 		printf("%s: unable to open file '%s'\n", __func__,
 		       pdata->filename);
 		ret = -EIO;
-- 
2.7.0.rc3.207.g0ac5344



More information about the U-Boot mailing list