From: Axel Lin Date: Thu, 22 Aug 2013 15:19:07 +0000 (+0800) Subject: spi: bcm2835: Add spi_master_get() call to prevent use after free X-Git-Tag: v3.12-rc1~192^2~36^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bc003100b61cdfe0515fe907010fe822353d924;p=pandora-kernel.git spi: bcm2835: Add spi_master_get() call to prevent use after free The call to spi_unregister_master results in device memory being freed, it must no longer be accessed afterwards. Thus call spi_master_get() to get an extra reference to the device and call spi_master_put() only after the last access to device data. Note, current code has an extra spi_master_put() call in bcm2835_spi_remove(). Thus this patch just adds an spi_master_get() to balance the reference count. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- Reading git-diff-tree failed