Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 May 2016 16:34:06 +0000 (UTC)
From:      Stephen McConnell <slm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299272 - head/sys/dev/mpr
Message-ID:  <201605091634.u49GY6KU040235@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: slm
Date: Mon May  9 16:34:06 2016
New Revision: 299272
URL: https://svnweb.freebsd.org/changeset/base/299272

Log:
  done_ccb pointer can be used if it is NULL.
  
  To prevent this, move check for done_ccb == NULL to before done_ccb is used in
  mprsas_stop_unit_done().
  
  Reviewed by:    ken, scottl, ambrisko, asomers
  Approved by:	ken, scottl, ambrisko
  MFC after:      1 week
  Differential Revision: https://reviews.freebsd.org/D6099

Modified:
  head/sys/dev/mpr/mpr_sas_lsi.c

Modified: head/sys/dev/mpr/mpr_sas_lsi.c
==============================================================================
--- head/sys/dev/mpr/mpr_sas_lsi.c	Mon May  9 16:31:43 2016	(r299271)
+++ head/sys/dev/mpr/mpr_sas_lsi.c	Mon May  9 16:34:06 2016	(r299272)
@@ -1272,15 +1272,15 @@ mprsas_stop_unit_done(struct cam_periph 
 	struct mprsas_softc *sassc;
 	char path_str[64];
 
+	if (done_ccb == NULL)
+		return;
+
 	sassc = (struct mprsas_softc *)done_ccb->ccb_h.ppriv_ptr1;
 
 	xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str));
 	mpr_dprint(sassc->sc, MPR_INFO, "Completing stop unit for %s\n",
 	    path_str);
 
-	if (done_ccb == NULL)
-		return;
-
 	/*
 	 * Nothing more to do except free the CCB and path.  If the command
 	 * timed out, an abort reset, then target reset will be issued during



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