Skip to content

Commit

Permalink
tcm_fc: rcu_deref outside rcu lock/unlock section
Browse files Browse the repository at this point in the history
Use rcu_dereference_protected in order to prevent lockdep
complaint. Sequel of the patch 863555b

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Acked-by: Mark D. Rustad <mark.d.rustad@intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Denis Efremov authored and Nicholas Bellinger committed Aug 20, 2012
1 parent 6de7145 commit 08a1620
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/target/tcm_fc/tfc_sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ static void ft_prlo(struct fc_rport_priv *rdata)
struct ft_tport *tport;

mutex_lock(&ft_lport_lock);
tport = rcu_dereference(rdata->local_port->prov[FC_TYPE_FCP]);
tport = rcu_dereference_protected(rdata->local_port->prov[FC_TYPE_FCP],
lockdep_is_held(&ft_lport_lock));

if (!tport) {
mutex_unlock(&ft_lport_lock);
return;
Expand Down

0 comments on commit 08a1620

Please sign in to comment.