Skip to content

Commit 08a1620

Browse files
evdenisNicholas Bellinger
authored andcommitted
tcm_fc: rcu_deref outside rcu lock/unlock section
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 <[email protected]> Acked-by: Mark D. Rustad <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent 6de7145 commit 08a1620

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/target/tcm_fc/tfc_sess.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ static void ft_prlo(struct fc_rport_priv *rdata)
456456
struct ft_tport *tport;
457457

458458
mutex_lock(&ft_lport_lock);
459-
tport = rcu_dereference(rdata->local_port->prov[FC_TYPE_FCP]);
459+
tport = rcu_dereference_protected(rdata->local_port->prov[FC_TYPE_FCP],
460+
lockdep_is_held(&ft_lport_lock));
461+
460462
if (!tport) {
461463
mutex_unlock(&ft_lport_lock);
462464
return;

0 commit comments

Comments
 (0)