]> git.sur5r.net Git - u-boot/commitdiff
sf: sf_ops: Stop leaking memory
authorMarek Vasut <marex@denx.de>
Sat, 12 Jul 2014 12:41:31 +0000 (18:11 +0530)
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Tue, 5 Aug 2014 18:48:01 +0000 (00:18 +0530)
It's usually a common pattern to free() the memory that we allocated.
Implement this here to stop leaking memory.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
drivers/mtd/spi/sf_ops.c

index ef91b924d7d69f75cb123b8e5a9385c090013d5a..85cf22d42ecd08761a149639ddbc2dda47ea590a 100644 (file)
@@ -421,6 +421,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
                data += read_len;
        }
 
+       free(cmd);
        return ret;
 }