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.

power: sequencing: fix missing state_lock in pwrseq_power_on() error path

pwrseq_power_on() calls pwrseq_unit_disable() when the
post_enable callback fails. However, this call is outside the
scoped_guard(mutex, &pwrseq->state_lock) block that ends.

pwrseq_unit_disable() has lockdep_assert_held(&pwrseq->state_lock),
which will fail when called from this error path.

Add the scoped_guard block to cover the post_enable callback and its
error handling to ensure the lock is held when pwrseq_unit_disable() is
called.

Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Link: https://patch.msgid.link/20260130182651.1576579-1-n7l8m4@u.northwestern.edu
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Ziyi Guo and committed by
Bartosz Golaszewski
e1dccb48 52e7b5bd

+4 -2
+4 -2
drivers/power/sequencing/core.c
··· 914 914 if (target->post_enable) { 915 915 ret = target->post_enable(pwrseq); 916 916 if (ret) { 917 - pwrseq_unit_disable(pwrseq, unit); 918 - desc->powered_on = false; 917 + scoped_guard(mutex, &pwrseq->state_lock) { 918 + pwrseq_unit_disable(pwrseq, unit); 919 + desc->powered_on = false; 920 + } 919 921 } 920 922 } 921 923