diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c index b7a4d3be65a5..80c1d408d8ad 100644 --- a/kernel/printk/nbcon.c +++ b/kernel/printk/nbcon.c @@ -1137,9 +1137,6 @@ static void nbcon_irq_work(struct irq_work *irq_work) static inline bool rcuwait_has_sleeper(struct rcuwait *w) { - bool has_sleeper; - - rcu_read_lock(); /* * Guarantee any new records can be seen by tasks preparing to wait * before this context checks if the rcuwait is empty. @@ -1152,10 +1149,7 @@ static inline bool rcuwait_has_sleeper(struct rcuwait *w) * This pairs with nbcon_kthread_func:A. */ smp_mb(); /* LMM(rcuwait_has_sleeper:A) */ - has_sleeper = !!rcu_dereference(w->task); - rcu_read_unlock(); - - return has_sleeper; + return rcuwait_active(w); } /**