Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jan 2009 21:05:17 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r187650 - head/sys/cam
Message-ID:  <200901232105.n0NL5H7P054269@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Fri Jan 23 21:05:16 2009
New Revision: 187650
URL: http://svn.freebsd.org/changeset/base/187650

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

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Fri Jan 23 21:03:59 2009	(r187649)
+++ head/sys/cam/cam_xpt.c	Fri Jan 23 21:05:16 2009	(r187650)
@@ -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);
 



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