From 9cf498d30d9770953c1035b5136fc55ab0540129 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 31 May 2003 18:41:09 +0000 Subject: Fix off-by-one error in drive number check. Don't return(foo(...)) in function returning void. Found by: FlexeLint --- sys/dev/ciss/ciss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index 6009b44..9608a15 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -973,7 +973,7 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives >= CISS_MAX_LOGICAL)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", ndrives, CISS_MAX_LOGICAL); return(ENXIO); @@ -2139,7 +2139,7 @@ ciss_cam_rescan_target(struct ciss_softc *sc, int target) static void ciss_cam_rescan_all(struct ciss_softc *sc) { - return(ciss_cam_rescan_target(sc, 0)); + ciss_cam_rescan_target(sc, 0); } static void @@ -2271,7 +2271,7 @@ ciss_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio) /* check for I/O attempt to nonexistent device */ if ((bus != 0) || - (target > CISS_MAX_LOGICAL) || + (target >= CISS_MAX_LOGICAL) || (sc->ciss_logical[target].cl_status == CISS_LD_NONEXISTENT)) { debug(3, " device does not exist"); csio->ccb_h.status = CAM_REQ_CMP_ERR; -- cgit v1.1