Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kcov: 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-4-elver@google.com

authored by

Marco Elver and committed by
Peter Zijlstra
b7be9442 d084a737

+1 -1
+1 -1
kernel/kcov.c
··· 530 530 kcov = kzalloc(sizeof(*kcov), GFP_KERNEL); 531 531 if (!kcov) 532 532 return -ENOMEM; 533 - spin_lock_init(&kcov->lock); 533 + guard(spinlock_init)(&kcov->lock); 534 534 kcov->mode = KCOV_MODE_DISABLED; 535 535 kcov->sequence = 1; 536 536 refcount_set(&kcov->refcount, 1);