Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 2017 15:27:52 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r325936 - stable/11/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201711171527.vAHFRqOu074300@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Nov 17 15:27:52 2017
New Revision: 325936
URL: https://svnweb.freebsd.org/changeset/base/325936

Log:
  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

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/dma-mapping.h	Fri Nov 17 15:23:42 2017	(r325935)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/dma-mapping.h	Fri Nov 17 15:27:52 2017	(r325936)
@@ -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
 		high = BUS_SPACE_MAXADDR_32BIT;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711171527.vAHFRqOu074300>