summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@free-electrons.com>2018-01-19 20:39:01 +0300
committerBoris Brezillon <boris.brezillon@free-electrons.com>2018-01-20 12:37:50 +0300
commitc495a9275eeca0bbc9358de7200e58184e864aeb (patch)
tree84d3d1f83b509ddaa6c0a006f9a09a6162150b18 /drivers/mtd
parente06a181b5dad6b1904e09e62c924868d7cfeacb6 (diff)
downloadlinux-c495a9275eeca0bbc9358de7200e58184e864aeb.tar.xz
mtd: nand: marvell: Fix missing memory allocation modifier
The function marvell_nfc_init_dma() allocates a DMA buffer without the GFP_KERNEL modifier, that triggers this warning: "marvell_nfc_init_dma() error: no modifiers for allocation." Fix this by using (GFP_KERNEL | GFP_DMA) instead of only GFP_DMA as the probe happens in non-interrupt context. Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/marvell_nand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/marvell_nand.c b/drivers/mtd/nand/marvell_nand.c
index f15ab37edf4e..2196f2a233d6 100644
--- a/drivers/mtd/nand/marvell_nand.c
+++ b/drivers/mtd/nand/marvell_nand.c
@@ -2649,7 +2649,7 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
* for DMA transfers and then copy the desired amount of data to
* the provided buffer.
*/
- nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_DMA);
+ nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_KERNEL | GFP_DMA);
if (!nfc->dma_buf)
return -ENOMEM;