Skip to content

Commit

Permalink
padata: Fix wrong usage of rcu_dereference()
Browse files Browse the repository at this point in the history
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+ torvalds#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: [<ffffffff8115c235>] padata_do_parallel+0x5/0x270

Fix that by using rcu_dereference_bh() instead.

Signed-off-by: Mathias Krause <[email protected]>
Acked-by: Steffen Klassert <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
minipli authored and herbertx committed Dec 5, 2013
1 parent 3110e40 commit c0e656b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c0e656b

Please sign in to comment.