Date: Thu, 7 Apr 2016 21:33:14 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297688 - head/sys/cam/scsi Message-ID: <201604072133.u37LXETl035657@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Thu Apr 7 21:33:14 2016 New Revision: 297688 URL: https://svnweb.freebsd.org/changeset/base/297688 Log: chdone(): Prevent returning uninitialized scalar value. Improve over the solution in r297527: 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 MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_ch.c Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Thu Apr 7 20:30:46 2016 (r297687) +++ head/sys/cam/scsi/scsi_ch.c Thu Apr 7 21:33:14 2016 (r297688) @@ -648,10 +648,14 @@ 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; - announce_buf[0] = '\0'; error = cherror(done_ccb, CAM_RETRY_SELTO, SF_RETRY_UA | SF_NO_PRINT); /* @@ -715,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); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604072133.u37LXETl035657>