projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2214889
)
repart: Turn condition into assert
author
Daan De Meyer
<daan.j.demeyer@gmail.com>
Wed, 26 Apr 2023 08:04:08 +0000
(10:04 +0200)
committer
Daan De Meyer
<daan.j.demeyer@gmail.com>
Wed, 26 Apr 2023 08:04:08 +0000
(10:04 +0200)
format_verity_hash() should only be called with VERITY_HASH type
partitions, so assert() if that's not the case.
src/partition/repart.c
patch
|
blob
|
history
diff --git
a/src/partition/repart.c
b/src/partition/repart.c
index 3a4808d6a4a09d0c95daceb0d10eb9f99a2929d2..448513ff4d848ca00f784d33a787ad0f02503519 100644
(file)
--- a/
src/partition/repart.c
+++ b/
src/partition/repart.c
@@
-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;