summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-02-24 09:14:55 -0700
committerSimon Glass <sjg@chromium.org>2016-02-26 08:53:10 -0700
commitffe276d27a538ca410d697126c562a1ce0ac8bbc (patch)
tree072899c19ddc692f8107ce500fa439a35e70f241 /drivers/mtd
parent20f655da11cdddfeb0814197f9b3c71d4d297061 (diff)
downloadblackbird-obmc-uboot-ffe276d27a538ca410d697126c562a1ce0ac8bbc.tar.gz
blackbird-obmc-uboot-ffe276d27a538ca410d697126c562a1ce0ac8bbc.zip
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 <sjg@chromium.org> Reviewed-by: Jagan Teki <jteki@openedev.com> Tested-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/spi/sandbox.c1
1 files changed, 0 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud