Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2018 14:05:13 +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: r329708 - head/sys/cam/scsi
Message-ID:  <201802211405.w1LE5DkB087426@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Wed Feb 21 14:05:13 2018
New Revision: 329708
URL: https://svnweb.freebsd.org/changeset/base/329708

Log:
  Use proper buffer length (the announce_buf char pointer used to be anarray),
  broken in r317143. This fixes those weird "cd0: Attempt" messages at boot.
  
  PR:		222103
  Reviewed by:	scottl@
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14369

Modified:
  head/sys/cam/scsi/scsi_cd.c

Modified: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c	Wed Feb 21 11:31:29 2018	(r329707)
+++ head/sys/cam/scsi/scsi_cd.c	Wed Feb 21 14:05:13 2018	(r329708)
@@ -1057,6 +1057,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
 
 		cdp = &softc->params;
 		announce_buf = softc->announce_temp;
+		bzero(announce_buf, CD_ANNOUNCETMP_SZ);
 
 		rdcap = (struct scsi_read_capacity_data *)csio->data_ptr;
 		
@@ -1127,7 +1128,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
 							&sense_key_desc,
 							&asc_desc);
 					snprintf(announce_buf,
-					    sizeof(announce_buf),
+					    CD_ANNOUNCETMP_SZ,
 						"Attempt to query device "
 						"size failed: %s, %s",
 						sense_key_desc,
@@ -1138,7 +1139,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
  				      && (csio->scsi_status ==
  					  SCSI_STATUS_BUSY)) {
  					snprintf(announce_buf,
- 					    sizeof(announce_buf),
+					    CD_ANNOUNCETMP_SZ,
  					    "Attempt to query device "
  					    "size failed: SCSI Status: %s",
 					    scsi_status_string(csio));



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