Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 2008 14:27:10 +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: r186318 - head/sys/cam
Message-ID:  <200812191427.mBJERA1k074114@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Fri Dec 19 14:27:10 2008
New Revision: 186318
URL: http://svn.freebsd.org/changeset/base/186318

Log:
  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:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Fri Dec 19 11:07:34 2008	(r186317)
+++ head/sys/cam/cam_periph.c	Fri Dec 19 14:27:10 2008	(r186318)
@@ -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?200812191427.mBJERA1k074114>