Skip to content

Commit 4153943

Browse files
melverPeter Zijlstra
authored andcommitted
tomoyo: Use scoped init guard
Convert lock initialization to scoped guarded initialization where lock-guarded members are initialized in the same scope. This ensures the context analysis treats the context as active during member initialization. This is required to avoid errors once implicit context assertion is removed. Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260119094029.1344361-6-elver@google.com
1 parent f39261f commit 4153943

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

security/tomoyo/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,7 @@ int tomoyo_open_control(const u8 type, struct file *file)
25572557

25582558
if (!head)
25592559
return -ENOMEM;
2560-
mutex_init(&head->io_sem);
2560+
guard(mutex_init)(&head->io_sem);
25612561
head->type = type;
25622562
switch (type) {
25632563
case TOMOYO_DOMAINPOLICY:

0 commit comments

Comments
 (0)