mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
crypto: 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-5-elver@google.com
This commit is contained in:
parent
b7be9442a3
commit
f39261f55b
2 changed files with 2 additions and 2 deletions
|
|
@ -453,7 +453,7 @@ struct crypto_engine *crypto_engine_alloc_init_and_set(struct device *dev,
|
|||
snprintf(engine->name, sizeof(engine->name),
|
||||
"%s-engine", dev_name(dev));
|
||||
|
||||
spin_lock_init(&engine->queue_lock);
|
||||
guard(spinlock_init)(&engine->queue_lock);
|
||||
crypto_init_queue(&engine->queue, qlen);
|
||||
|
||||
engine->kworker = kthread_run_worker(0, "%s", engine->name);
|
||||
|
|
|
|||
|
|
@ -1780,7 +1780,7 @@ static inline int __init drbg_healthcheck_sanity(void)
|
|||
if (!drbg)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_init(&drbg->drbg_mutex);
|
||||
guard(mutex_init)(&drbg->drbg_mutex);
|
||||
drbg->core = &drbg_cores[coreref];
|
||||
drbg->reseed_threshold = drbg_max_requests(drbg);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue