svn commit: r327709 - head/sys/cam

Scott Long scottl at FreeBSD.org
Tue Jan 9 00:00:56 UTC 2018


Author: scottl
Date: Tue Jan  9 00:00:55 2018
New Revision: 327709
URL: https://svnweb.freebsd.org/changeset/base/327709

Log:
  Protect against a possible NULL deference from an accessor
  function.
  
  Obtained from:	Netflix

Modified:
  head/sys/cam/cam_periph.h

Modified: head/sys/cam/cam_periph.h
==============================================================================
--- head/sys/cam/cam_periph.h	Mon Jan  8 22:59:36 2018	(r327708)
+++ head/sys/cam/cam_periph.h	Tue Jan  9 00:00:55 2018	(r327709)
@@ -202,7 +202,10 @@ int		cam_periph_error(union ccb *ccb, cam_flags camfla
 static __inline struct mtx *
 cam_periph_mtx(struct cam_periph *periph)
 {
-	return (xpt_path_mtx(periph->path));
+	if (periph != NULL)
+		return (xpt_path_mtx(periph->path));
+	else
+		return (NULL);
 }
 
 #define cam_periph_owned(periph)					\


More information about the svn-src-all mailing list