mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
repart: Turn condition into assert
format_verity_hash() should only be called with VERITY_HASH type partitions, so assert() if that's not the case.
This commit is contained in:
@@ -3559,6 +3559,7 @@ static int partition_format_verity_hash(
|
||||
|
||||
assert(context);
|
||||
assert(p);
|
||||
assert(p->verity == VERITY_HASH);
|
||||
assert(data_node);
|
||||
|
||||
if (p->dropped)
|
||||
@@ -3567,9 +3568,6 @@ static int partition_format_verity_hash(
|
||||
if (PARTITION_EXISTS(p)) /* Never format existing partitions */
|
||||
return 0;
|
||||
|
||||
if (p->verity != VERITY_HASH)
|
||||
return 0;
|
||||
|
||||
if (partition_defer(p))
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user