diff options
author | Axel Lin <axel.lin@ingics.com> | 2015-02-09 15:11:09 +0800 |
---|---|---|
committer | Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> | 2015-03-30 01:39:20 +0530 |
commit | 81a66446c319225c4a8f0c4c0d9cf4ee10f8c2b9 (patch) | |
tree | 829c56c5913793f6ee1f0d5325a63027f2b6c142 | |
parent | aa8306a90e398e5667ccd03ef8512837116bcc51 (diff) | |
download | u-boot-imx-81a66446c319225c4a8f0c4c0d9cf4ee10f8c2b9.zip u-boot-imx-81a66446c319225c4a8f0c4c0d9cf4ee10f8c2b9.tar.gz u-boot-imx-81a66446c319225c4a8f0c4c0d9cf4ee10f8c2b9.tar.bz2 |
spi: ftssp010_spi: Use to_ftssp010_spi() to ensure free correct address
Don't assume slave is always the first member of struct ftssp010_spi.
Use to_ftssp010_spi() to ensure free correct address in spi_free_slave().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
-rw-r--r-- | drivers/spi/ftssp010_spi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/ftssp010_spi.c b/drivers/spi/ftssp010_spi.c index 267e4d8..c7d6480 100644 --- a/drivers/spi/ftssp010_spi.c +++ b/drivers/spi/ftssp010_spi.c @@ -431,7 +431,9 @@ free_out: void spi_free_slave(struct spi_slave *slave) { - free(slave); + struct ftssp010_spi *chip = to_ftssp010_spi(slave); + + free(chip); } int spi_claim_bus(struct spi_slave *slave) |