]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tomoyo: Use scoped init guard
authorMarco Elver <elver@google.com>
Mon, 19 Jan 2026 09:05:55 +0000 (10:05 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 28 Jan 2026 19:45:25 +0000 (20:45 +0100)
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
security/tomoyo/common.c

index 86ce56c32d377224ddf1e635f0bcf4a38c5c92fc..7e1f825d903b3cdf6d08092786a3c1ab2f8b71f9 100644 (file)
@@ -2557,7 +2557,7 @@ int tomoyo_open_control(const u8 type, struct file *file)
 
        if (!head)
                return -ENOMEM;
-       mutex_init(&head->io_sem);
+       guard(mutex_init)(&head->io_sem);
        head->type = type;
        switch (type) {
        case TOMOYO_DOMAINPOLICY: