spi: spi_device memory should be released instead of device.

Previous thread: musb_core: don't touch 'musb->clock' in musb_free() by Linux Kernel Mailing List on Friday, April 30, 2010 - 10:59 am. (1 message)

Next thread: nfs d_revalidate() is too trigger-happy with d_drop() by Linux Kernel Mailing List on Wednesday, April 28, 2010 - 8:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Friday, April 30, 2010 - 10:59 am

Gitweb:     http://git.kernel.org/linus/07a389feefd79d41c8542cf31ce1cf25a1466e2c
Commit:     07a389feefd79d41c8542cf31ce1cf25a1466e2c
Parent:     8ec130a017ebd8b931344edde7013ffb18fa1965
Author:     Roman Tereshonkov <roman.tereshonkov@nokia.com>
AuthorDate: Mon Apr 12 09:56:35 2010 +0000
Committer:  Grant Likely <grant.likely@secretlab.ca>
CommitDate: Wed Apr 28 01:17:58 2010 -0600

    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>
---
 drivers/spi/spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index ec429d1..b3a1f92 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
--

Previous thread: musb_core: don't touch 'musb->clock' in musb_free() by Linux Kernel Mailing List on Friday, April 30, 2010 - 10:59 am. (1 message)

Next thread: nfs d_revalidate() is too trigger-happy with d_drop() by Linux Kernel Mailing List on Wednesday, April 28, 2010 - 8:59 pm. (1 message)