summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-21 14:57:44 +0000
committerpfg <pfg@FreeBSD.org>2016-04-21 14:57:44 +0000
commit9d7941c5e3fb5b88a8ce9d2f5bd0ac81d553981e (patch)
treeff161b0499954368b5f5530aad8d6fae406c2797
parentb1bc0c99b3c1f2058f5ae54434ec41cc6b770355 (diff)
downloadFreeBSD-src-9d7941c5e3fb5b88a8ce9d2f5bd0ac81d553981e.zip
FreeBSD-src-9d7941c5e3fb5b88a8ce9d2f5bd0ac81d553981e.tar.gz
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
-rw-r--r--sys/cam/scsi/scsi_ch.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 137128d..077371d 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -648,6 +648,11 @@ chdone(struct cam_periph *periph, union ccb *done_ccb)
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 ccb *done_ccb)
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);
/*
OpenPOWER on IntegriCloud