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 <[email protected]>
--- drivers/spi/ftssp010_spi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/spi/ftssp010_spi.c +3 -1
@@ -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)
Signature · 1 line
1.9.1
Quoted 24 lines · Axel Lin
Don't assume slave is always the first member of struct
ftssp010_spi. Useto_ftssp010_spi()to ensure free correct address inspi_free_slave().Signed-off-by Axel Lin <[email protected]>--- drivers/spi/ftssp010_spi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/spi/ftssp010_spi.c +3
-2@@ -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) --
Quoted 4 lines
1.9.1
Applied to u-boot-spi/master
thanks!
Signature · 1 line
Jagan.