From: Simon Glass Date: Wed, 24 Feb 2016 16:14:55 +0000 (-0700) Subject: sandbox: spi: Remove an incorrect free() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=ffe276d27a538ca410d697126c562a1ce0ac8bbc;p=u-boot.git sandbox: spi: Remove an incorrect free() 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 Reviewed-by: Jagan Teki Tested-by: Jagan Teki Reviewed-by: Tom Rini --- diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c index ec07be71a1..53470b90ce 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;