Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Apr 2016 15:02:58 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r298407 - stable/9/sys/cam/scsi
Message-ID:  <201604211502.u3LF2wT0016827@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Thu Apr 21 15:02:57 2016
New Revision: 298407
URL: https://svnweb.freebsd.org/changeset/base/298407

Log:
  MFC r297527, r297688:
  chdone(): Prevent returning uninitialized scalar value.
  
  Instead of attempting to initialize all the possible cases, just
  move the check nearer to the case where it makes sense.
  
  CID:		1006486
  Reviewed by:	ken

Modified:
  stable/9/sys/cam/scsi/scsi_ch.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_ch.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_ch.c	Thu Apr 21 14:57:44 2016	(r298406)
+++ stable/9/sys/cam/scsi/scsi_ch.c	Thu Apr 21 15:02:57 2016	(r298407)
@@ -649,6 +649,11 @@ chdone(struct cam_periph *periph, union 
 		    		softc->sc_counts[CHET_IE],
 				PLURAL(softc->sc_counts[CHET_IE]));
 #undef PLURAL
+			if (announce_buf[0] != '\0') {
+				xpt_announce_periph(periph, announce_buf);
+				xpt_announce_quirks(periph, softc->quirks,
+				    CH_Q_BIT_STRING);
+			}
 		} else {
 			int error;
 
@@ -712,14 +717,8 @@ chdone(struct cam_periph *periph, union 
 
 				cam_periph_invalidate(periph);
 
-				announce_buf[0] = '\0';
 			}
 		}
-		if (announce_buf[0] != '\0') {
-			xpt_announce_periph(periph, announce_buf);
-			xpt_announce_quirks(periph, softc->quirks,
-			    CH_Q_BIT_STRING);
-		}
 		softc->state = CH_STATE_NORMAL;
 		free(mode_header, M_SCSICH);
 		/*



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