Skip to content

Commit f39261f

Browse files
melverPeter Zijlstra
authored andcommitted
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
1 parent b7be944 commit f39261f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

crypto/crypto_engine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ struct crypto_engine *crypto_engine_alloc_init_and_set(struct device *dev,
453453
snprintf(engine->name, sizeof(engine->name),
454454
"%s-engine", dev_name(dev));
455455

456-
spin_lock_init(&engine->queue_lock);
456+
guard(spinlock_init)(&engine->queue_lock);
457457
crypto_init_queue(&engine->queue, qlen);
458458

459459
engine->kworker = kthread_run_worker(0, "%s", engine->name);

crypto/drbg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ static inline int __init drbg_healthcheck_sanity(void)
17801780
if (!drbg)
17811781
return -ENOMEM;
17821782

1783-
mutex_init(&drbg->drbg_mutex);
1783+
guard(mutex_init)(&drbg->drbg_mutex);
17841784
drbg->core = &drbg_cores[coreref];
17851785
drbg->reseed_threshold = drbg_max_requests(drbg);
17861786

0 commit comments

Comments
 (0)