Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Feb 2009 10:29:55 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r189146 - in stable/7/sys: . cam contrib/pf dev/cxgb
Message-ID:  <200902281029.n1SATtIM002708@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sat Feb 28 10:29:55 2009
New Revision: 189146
URL: http://svn.freebsd.org/changeset/base/189146

Log:
  MFC r186318:
  
  Move mtx_assert lower, when we can be sure that the pointer
  to the mutex is valid.
  
  Reviewed by:	scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation

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

Modified: stable/7/sys/cam/cam_periph.c
==============================================================================
--- stable/7/sys/cam/cam_periph.c	Sat Feb 28 10:27:46 2009	(r189145)
+++ stable/7/sys/cam/cam_periph.c	Sat Feb 28 10:29:55 2009	(r189146)
@@ -311,8 +311,6 @@ cam_periph_hold(struct cam_periph *perip
 	struct mtx *mtx;
 	int error;
 
-	mtx_assert(periph->sim->mtx, MA_OWNED);
-
 	/*
 	 * Increment the reference count on the peripheral
 	 * while we wait for our lock attempt to succeed
@@ -324,6 +322,7 @@ cam_periph_hold(struct cam_periph *perip
 		return (ENXIO);
 
 	mtx = periph->sim->mtx;
+	mtx_assert(mtx, MA_OWNED);
 	if (mtx == &Giant)
 		mtx = NULL;
 



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