From: Mathias Krause Date: Thu, 28 Nov 2013 18:20:05 +0000 (+0100) Subject: padata: Fix wrong usage of rcu_dereference() X-Git-Tag: upstream/snapshot3+hdmi~3595^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0e656b7a6e1ac03b2921d49211a735893efd544;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git padata: Fix wrong usage of rcu_dereference() A kernel with enabled lockdep complains about the wrong usage of rcu_dereference() under a rcu_read_lock_bh() protected region. =============================== [ INFO: suspicious RCU usage. ] 3.13.0-rc1+ #126 Not tainted ------------------------------- linux/kernel/padata.c:115 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 1, debug_locks = 1 1 lock held by cryptomgr_test/153: #0: (rcu_read_lock_bh){.+....}, at: [] padata_do_parallel+0x5/0x270 Fix that by using rcu_dereference_bh() instead. Signed-off-by: Mathias Krause Acked-by: Steffen Klassert Signed-off-by: Herbert Xu --- diff --git a/kernel/padata.c b/kernel/padata.c index 2abd25d..161402f 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -112,7 +112,7 @@ int padata_do_parallel(struct padata_instance *pinst, rcu_read_lock_bh(); - pd = rcu_dereference(pinst->pd); + pd = rcu_dereference_bh(pinst->pd); err = -EINVAL; if (!(pinst->flags & PADATA_INIT) || pinst->flags & PADATA_INVALID)