diff --git a/sys/dev/raid/ciss/ciss.c b/sys/dev/raid/ciss/ciss.c --- a/sys/dev/raid/ciss/ciss.c +++ b/sys/dev/raid/ciss/ciss.c @@ -1550,6 +1550,12 @@ */ bus = CISS_EXTRA_BUS2(ea) - 1; target = CISS_EXTRA_TARGET2(ea); + if (bus < 0 || bus >= sc->ciss_max_physical_bus || + target >= CISS_MAX_PHYSTGT) { + ciss_printf(sc, "physical device %d has out-of-range " + "address bus %d target %d\n", i, bus, target); + continue; + } sc->ciss_physical[bus][target].cp_address = cll->lun[i]; sc->ciss_physical[bus][target].cp_online = 1; }