Search Linux Wireless

[PATCH 2/2] p54spi: fix p54_upload_firmware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 Instead of firmware itself p54_upload_firmware was sending to the device content of struct firmware
 and the following random garbage. Notice '&' before priv->firmware->data at p54spi_spi_write.
 But simple removing of '&' sign triggered BUG_ON at dma_cache_maint. Thus kmemdup - kfree workaround.

Signed-off-by: Max Filippov <jcmvbkbc@xxxxxxxxx>
---
 drivers/net/wireless/p54/p54spi.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index d13268f..4ef57c5 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -265,8 +265,15 @@ static int p54spi_upload_firmware(struct ieee80211_hw *dev)
 		p54spi_write32(priv, SPI_ADRS_DMA_WRITE_BASE,
 			       cpu_to_le32(fw_addr));
 
-		p54spi_spi_write(priv, SPI_ADRS_DMA_DATA,
-				 &priv->firmware->data, _fw_len);
+		{
+			void *fw = kmemdup(priv->firmware->data, _fw_len, GFP_KERNEL);
+			if (fw)
+			{
+				p54spi_spi_write(priv, SPI_ADRS_DMA_DATA,
+						 fw, _fw_len);
+				kfree(fw);
+			}
+		}
 
 		fw_len -= _fw_len;
 		fw_addr += _fw_len;
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux