提交 81a66446 编写于 作者: A Axel Lin 提交者: Jagannadha Sutradharudu Teki

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: NAxel Lin <axel.lin@ingics.com>
Reviewed-by: NJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
上级 aa8306a9
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册