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>
This commit is contained in:
parent
aa8306a90e
commit
81a66446c3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user