From 08e14bad94568452317d9da9acf0001e769f5106 Mon Sep 17 00:00:00 2001 From: Hans-Peter Jansen Date: Mon, 11 Sep 2017 10:38:48 +0200 Subject: [PATCH] fix changed kmalloc flag for kernel >= 4.13 --- ddbridge/ddbridge-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ddbridge/ddbridge-core.c b/ddbridge/ddbridge-core.c index 95ce288..0d8f3fe 100644 --- a/ddbridge/ddbridge-core.c +++ b/ddbridge/ddbridge-core.c @@ -267,7 +267,11 @@ static int dma_alloc(struct pci_dev *pdev, struct ddb_dma *dma, int dir) return 0; for (i = 0; i < dma->num; i++) { if (alt_dma) { +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)) dma->vbuf[i] = kmalloc(dma->size, __GFP_REPEAT); +#else + dma->vbuf[i] = kmalloc(dma->size, __GFP_RETRY_MAYFAIL); +#endif if (!dma->vbuf[i]) return -ENOMEM; dma->pbuf[i] = dma_map_single(&pdev->dev,