svn commit: r298406 - stable/10/sys/cam/scsi

Pedro F. Giffuni pfg at FreeBSD.org
Thu Apr 21 14:57:45 UTC 2016


Author: pfg
Date: Thu Apr 21 14:57:44 2016
New Revision: 298406
URL: https://svnweb.freebsd.org/changeset/base/298406

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/10/sys/cam/scsi/scsi_ch.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/scsi/scsi_ch.c
==============================================================================
--- stable/10/sys/cam/scsi/scsi_ch.c	Thu Apr 21 14:25:45 2016	(r298405)
+++ stable/10/sys/cam/scsi/scsi_ch.c	Thu Apr 21 14:57:44 2016	(r298406)
@@ -648,6 +648,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;
 
@@ -714,14 +719,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);
 		/*


More information about the svn-src-all mailing list