diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2016-09-12 20:09:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-27 12:43:35 +0200 |
commit | 13decfb4383b13b0f75e88709f4fad9138bd243b (patch) | |
tree | 09662f62e3447d6e88dfdb732823fab180591d39 /drivers/misc/genwqe/card_utils.c | |
parent | db08948b97180a3c9f49ce91caf1fb643a8110be (diff) | |
download | linux-13decfb4383b13b0f75e88709f4fad9138bd243b.tar.bz2 |
misc/genwqe: ensure zero initialization
Genwqe uses dma_alloc_coherent and depends on zero initialized memory. On
one occasion it ueses an explicit memset on others it uses un-initialized
memory.
This bug was covered because some archs actually return zero initialized
memory when using dma_alloc_coherent but this is by no means guaranteed.
Simply switch to dma_zalloc_coherent.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/genwqe/card_utils.c')
-rw-r--r-- | drivers/misc/genwqe/card_utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c index 222367cc8c81..8a679ecc8fd1 100644 --- a/drivers/misc/genwqe/card_utils.c +++ b/drivers/misc/genwqe/card_utils.c @@ -220,8 +220,8 @@ void *__genwqe_alloc_consistent(struct genwqe_dev *cd, size_t size, if (get_order(size) > MAX_ORDER) return NULL; - return dma_alloc_coherent(&cd->pci_dev->dev, size, dma_handle, - GFP_KERNEL); + return dma_zalloc_coherent(&cd->pci_dev->dev, size, dma_handle, + GFP_KERNEL); } void __genwqe_free_consistent(struct genwqe_dev *cd, size_t size, |