]> git.karo-electronics.de Git - karo-tx-linux.git/commit
spi: rspi: Add spi_master_get() call to prevent use after free
authorAxel Lin <axel.lin@ingics.com>
Sat, 31 Aug 2013 11:42:56 +0000 (19:42 +0800)
committerMark Brown <broonie@linaro.org>
Sat, 31 Aug 2013 11:58:53 +0000 (12:58 +0100)
commit9d3405dbbbd8418a095301d495da65bc3bc5f806
tree9ff232800a36890202d8f87be7a6cc4b8ddabe55
parent8d4d08ce8319ae26227c4dd558405963c14c2037
spi: rspi: Add spi_master_get() call to prevent use after free

In rspi_remove(), current code dereferences rspi after spi_unregister_master(),
thus add an extra spi_master_get() call is necessary to prevent use after free.

Current code already has an extra spi_master_put() call in rspi_remove(), so
this patch just adds a spi_master_get() call rather than a spi_master_get() with
spi_master_put() calls.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-rspi.c