From: Martin Sperl Date: Mon, 25 May 2015 10:13:10 +0000 (+0000) Subject: spi: restore rx/tx_buf in case of unset CONFIG_HAS_DMA X-Git-Tag: omap-for-v4.2/fixes-rc1^2~146^2~7^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b786458ed99eae9e9d9984a1624a79e9bf6cebb;p=pandora-kernel.git spi: restore rx/tx_buf in case of unset CONFIG_HAS_DMA The case where spi_master sets the flags SPI_MASTER_MUST_RX/TX while CONFIG_HAS_DMA is unset (which is unlikley) together with a driver that reuses spi_messages with rx/tx_buff set to NULL, can result in: * data disclosure over the SPI (for tx_buf == NULL) * memory corruption (for rx_buf == NULL) This happenes when dummy_rx/dummy_tx are changing address due to krealloc or free and an allocation of the memory by a different part of the kernel. Signed-off-by: Martin Sperl Signed-off-by: Mark Brown --- Reading git-diff-tree failed