svn commit: r189158 - in stable/7/sys: . cam contrib/pf dev/ath/ath_hal dev/cxgb

Edward Tomasz Napierala trasz at FreeBSD.org
Sat Feb 28 02:59:49 PST 2009


Author: trasz
Date: Sat Feb 28 10:59:48 2009
New Revision: 189158
URL: http://svn.freebsd.org/changeset/base/189158

Log:
  MFC r187650:
  
  Guard against NULL pointer dereference.
  
  Reviewed by:	scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation
  Found with:	Coverity Prevent(tm)
  CID:		1847

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/cam/cam_xpt.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/cam/cam_xpt.c
==============================================================================
--- stable/7/sys/cam/cam_xpt.c	Sat Feb 28 10:53:20 2009	(r189157)
+++ stable/7/sys/cam/cam_xpt.c	Sat Feb 28 10:59:48 2009	(r189158)
@@ -4177,7 +4177,10 @@ xpt_path_string(struct cam_path *path, c
 {
 	struct sbuf sb;
 
-	mtx_assert(path->bus->sim->mtx, MA_OWNED);
+#ifdef INVARIANTS
+	if (path != NULL && path->bus != NULL && path->bus->sim != NULL)
+		mtx_assert(path->bus->sim->mtx, MA_OWNED);
+#endif
 
 	sbuf_new(&sb, str, str_len, 0);
 


More information about the svn-src-stable-7 mailing list