Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: spi_device memory should be released instead of device.

The memory for dev variable is allocated as a part of
spi_device structure memory which the dev belongs to.
Thus when the memory is released the right pointer is used.

Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by

Roman Tereshonkov and committed by
Grant Likely
07a389fe 8ec130a0

+1 -1
+1 -1
drivers/spi/spi.c
··· 41 41 spi->master->cleanup(spi); 42 42 43 43 spi_master_put(spi->master); 44 - kfree(dev); 44 + kfree(spi); 45 45 } 46 46 47 47 static ssize_t