mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-01 02:33:01 +09:00
spi: dw: Don't call kfree for memory allocated by devm_kzalloc
commitc63f5da008upstream. With devm_kzalloc, the memory is automatically freed when spi_device detach from the bus. Fixes: commit43f627ac9d(spi: dw: fix memory leak on error path) Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1e3fe0a434
commit
f2fa919e04
@@ -671,12 +671,6 @@ static int dw_spi_setup(struct spi_device *spi)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dw_spi_cleanup(struct spi_device *spi)
|
||||
{
|
||||
struct chip_data *chip = spi_get_ctldata(spi);
|
||||
kfree(chip);
|
||||
}
|
||||
|
||||
static int init_queue(struct dw_spi *dws)
|
||||
{
|
||||
INIT_LIST_HEAD(&dws->queue);
|
||||
@@ -806,7 +800,6 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
|
||||
master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16);
|
||||
master->bus_num = dws->bus_num;
|
||||
master->num_chipselect = dws->num_cs;
|
||||
master->cleanup = dw_spi_cleanup;
|
||||
master->setup = dw_spi_setup;
|
||||
master->transfer = dw_spi_transfer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user