Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754329Ab2HRMJL (ORCPT ); Sat, 18 Aug 2012 08:09:11 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]:38514 "EHLO mail-lpp01m010-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878Ab2HRMJH (ORCPT ); Sat, 18 Aug 2012 08:09:07 -0400 From: Denis Efremov To: "Nicholas A. Bellinger" Cc: Denis Efremov , "Paul E. McKenney" , Jesper Juhl , target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@ispras.ru Subject: [PATCH] tcm_fc: rcu_deref outside rcu lock/unlock section Date: Sat, 18 Aug 2012 16:10:31 +0400 Message-Id: <1345291831-5086-1-git-send-email-yefremov.denis@gmail.com> X-Mailer: git-send-email 1.7.7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1135 Lines: 33 Use rcu_dereference_protected in order to prevent lockdep complaint. Sequel of the patch 863555be Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Denis Efremov --- drivers/target/tcm_fc/tfc_sess.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index 87901fa..3c9e5b5 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c @@ -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; -- 1.7.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/