Index: sys/cam/cam_periph.c =================================================================== --- sys/cam/cam_periph.c +++ sys/cam/cam_periph.c @@ -611,32 +611,34 @@ unit = 0; i = 0; dname = periph_name; + wired = false; while (resource_find_dev(&i, dname, &dunit, NULL, NULL) == 0) { - wired = false; if (resource_string_value(dname, dunit, "at", &strval) == 0) { if (strcmp(strval, pathbuf) != 0) - continue; + goto next; wired = true; } if (resource_int_value(dname, dunit, "target", &val) == 0) { if (val != target) - continue; + goto next; wired = true; } if (resource_int_value(dname, dunit, "lun", &val) == 0) { if (val != lun) - continue; + goto next; wired = true; } if (resource_string_value(dname, dunit, "sn", &strval) == 0) { if (sn == NULL || strcmp(strval, sn) != 0) - continue; + goto next; wired = true; } if (wired) { unit = dunit; break; } +next: + wired = false; } /*