From 4f8759e9aad15258565d964d2095eb5cf1dc1573 Mon Sep 17 00:00:00 2001 From: hselasky Date: Fri, 17 Nov 2017 15:32:27 +0000 Subject: [PATCH] MFC r325533: Make the dma_alloc_coherent() function in the LinuxKPI NULL safe with regard to the "dev" argument. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications git-svn-id: svn://svn.freebsd.org/base/stable/9@325938 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/ofed/include/linux/dma-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ofed/include/linux/dma-mapping.h b/sys/ofed/include/linux/dma-mapping.h index 39367f09d..882c5ffc2 100644 --- a/sys/ofed/include/linux/dma-mapping.h +++ b/sys/ofed/include/linux/dma-mapping.h @@ -126,7 +126,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, size_t align; void *mem; - if (dev->dma_mask) + if (dev != NULL && dev->dma_mask) high = *dev->dma_mask; else high = BUS_SPACE_MAXADDR_32BIT; -- 2.42.0