DORMANTno replies

[PATCH] spi/pxa2xx: fix null_dma_buf out of allocated memory.

From: Yu Xu <hidden>
Date: 2011-12-08 05:00:28
Subsystem: pxa2xx/pxa3xx support, spi subsystem, the rest · Maintainers: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Mark Brown, Linus Torvalds

spi_alloc_master allocates memory for null_dma_buf,
but actually null_dma_buf is out of that region.
The null_dma_buf address may be used by others.
When doing spi write, null_dma_buf will be written,
and impacts that using the address.

Signed-off-by: Yu Xu <redacted>
---
 drivers/spi/spi-pxa2xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index dc25bee..82a9b86 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1569,7 +1569,7 @@ static int __devinit pxa2xx_spi_probe(struct platform_device *pdev)
 	master->transfer = transfer;
 
 	drv_data->ssp_type = ssp->type;
-	drv_data->null_dma_buf = (u32 *)ALIGN((u32)(drv_data +
+	drv_data->null_dma_buf = (u32 *)ALIGN((u32)((u32)drv_data +
 						sizeof(struct driver_data)), 8);
 
 	drv_data->ioaddr = ssp->mmio_base;
-- 
1.7.5.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help