From: Roman Tereshonkov Date: Mon, 12 Apr 2010 09:56:35 +0000 (+0000) Subject: spi: spi_device memory should be released instead of device. X-Git-Tag: firefly_0821_release~9833^2~2246^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=07a389feefd79d41c8542cf31ce1cf25a1466e2c;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Grant Likely --- diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index ec429d156a57..b3a1f9259b62 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -41,7 +41,7 @@ static void spidev_release(struct device *dev) spi->master->cleanup(spi); spi_master_put(spi->master); - kfree(dev); + kfree(spi); } static ssize_t