mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 06:30:30 +00:00
dissect-image: replace redundant if check by assert()
We know that the designator can only be USR or ROOT (or negative), hence let's test that with an assert here, instead of doing an if check.
This commit is contained in:
@@ -1414,9 +1414,10 @@ int dissect_image(
|
||||
/* If we found a verity setup, then the root partition is necessarily read-only. */
|
||||
m->partitions[PARTITION_ROOT].rw = false;
|
||||
m->verity_ready = true;
|
||||
}
|
||||
|
||||
if (verity->designator == PARTITION_USR) {
|
||||
} else {
|
||||
assert(verity->designator == PARTITION_USR);
|
||||
|
||||
if (!m->partitions[PARTITION_USR_VERITY].found || !m->partitions[PARTITION_USR].found)
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user