Skip to content

Commit

Permalink
Updated LUN check
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Aug 28, 2022
1 parent 6a80049 commit 4730781
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/raspberrypi/controllers/scsi_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,18 @@ void ScsiController::Selection()
return;
}

// Abort if there is no LUN for this controller
if (ctrl.luns.empty()) {
assert(false);
return;
}
// Abort if there is no valid LUN
bool has_valid_unit = false;
for (int i = 0; i < LUN_MAX; i++) {
if (HasLunDevice(i)) {
has_valid_unit = true;
break;
}
}
if (!has_valid_unit) {
assert(false);
return;
}

LOGTRACE("%s Selection Phase ID=%d (with device)", __PRETTY_FUNCTION__, (int)ctrl.scsi_id);

Expand Down

0 comments on commit 4730781

Please sign in to comment.