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
This commit is contained in:
trasz 2018-02-21 14:05:13 +00:00
parent ef80f6306d
commit 6ccea74d8c

View File

@ -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));