Skip to content

Commit

Permalink
ddc_get_dref_by_busno_dor_connector(): fix test for non-removed displ…
Browse files Browse the repository at this point in the history
…ays <= 1

also just abort in the very very very rare case where more than
one non-removed displays are found and parm ignore_invalid is set.
It's unclear what the proper recovery is in this case, and at present
there are no calls to ddc_get_dref_by_busno_or_connector() with
ignore_invalid set true.

Consider eliminating parm ignore_invalid.
  • Loading branch information
rockowitz committed Sep 13, 2024
1 parent 424c48d commit af94890
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ddc/ddc_displays.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,11 @@ Display_Ref * ddc_get_dref_by_busno_or_connector(
}
}
// assert(non_removed_ct <= 1);
if (non_removed_ct > 0) {
if (non_removed_ct > 1) {
if (!ignore_invalid) {
// don't try to recover from this very very very rare case
assert(non_removed_ct <= 1);
}
SEVEREMSG("Multiple non-removed displays on device %s detected. "
"All but the most recent are being marked DDC_REMOVED",
dpath_repr_t(&result->io_path));
Expand Down

0 comments on commit af94890

Please sign in to comment.