svn commit: r325533 - head/sys/compat/linuxkpi/common/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Wed Nov 8 08:37:07 UTC 2017


Author: hselasky
Date: Wed Nov  8 08:37:05 2017
New Revision: 325533
URL: https://svnweb.freebsd.org/changeset/base/325533

Log:
  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
  MFC after:	1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h

Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h	Wed Nov  8 08:21:17 2017	(r325532)
+++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h	Wed Nov  8 08:37:05 2017	(r325533)
@@ -127,7 +127,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dm
 	size_t align;
 	void *mem;
 
-	if (dev->dma_mask)
+	if (dev != NULL && dev->dma_mask)
 		high = *dev->dma_mask;
 	else if (flag & GFP_DMA32)
 		high = BUS_SPACE_MAXADDR_32BIT;


More information about the svn-src-head mailing list