Browse Source

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>
Roman Tereshonkov 15 năm trước cách đây
mục cha
commit
07a389feef
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      drivers/spi/spi.c

+ 1 - 1
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