summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-12-14 09:00:40 +0100
committerChristoph Hellwig <hch@lst.de>2018-12-20 08:13:52 +0100
commit518a2f1925c3165befbf06b75e07636549d92c1c (patch)
tree629130481205f514709c3cc84a2f5debed28f8cd /drivers/misc/mic
parent6c503d0d88db9d57c1dc4c87175c94766b6a6c61 (diff)
downloadblackbird-obmc-linux-518a2f1925c3165befbf06b75e07636549d92c1c.tar.gz
blackbird-obmc-linux-518a2f1925c3165befbf06b75e07636549d92c1c.zip
dma-mapping: zero memory returned from dma_alloc_*
If we want to map memory from the DMA allocator to userspace it must be zeroed at allocation time to prevent stale data leaks. We already do this on most common architectures, but some architectures don't do this yet, fix them up, either by passing GFP_ZERO when we use the normal page allocator or doing a manual memset otherwise. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k] Acked-by: Sam Ravnborg <sam@ravnborg.org> [sparc]
Diffstat (limited to 'drivers/misc/mic')
-rw-r--r--drivers/misc/mic/host/mic_boot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/mic/host/mic_boot.c b/drivers/misc/mic/host/mic_boot.c
index c327985c9523..6479435ac96b 100644
--- a/drivers/misc/mic/host/mic_boot.c
+++ b/drivers/misc/mic/host/mic_boot.c
@@ -149,7 +149,7 @@ static void *__mic_dma_alloc(struct device *dev, size_t size,
struct scif_hw_dev *scdev = dev_get_drvdata(dev);
struct mic_device *mdev = scdev_to_mdev(scdev);
dma_addr_t tmp;
- void *va = kmalloc(size, gfp);
+ void *va = kmalloc(size, gfp | __GFP_ZERO);
if (va) {
tmp = mic_map_single(mdev, va, size);
OpenPOWER on IntegriCloud