From: Arnd Bergmann <arnd@arndb.de>
To: Johannes Thumshirn <jth@kernel.org>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Hannes Reinecke <hare@suse.de>,
Satish Kharat <satishkh@cisco.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: libfc: drop an incorrect assertion
Date: Wed, 11 Jul 2018 22:15:24 +0200 [thread overview]
Message-ID: <20180711201617.898598-1-arnd@arndb.de> (raw)
gcc points out one case in which the added lockdep_assert_held()
is wrong:
In file included from include/linux/spinlock_types.h:18,
from include/linux/spinlock.h:82,
from drivers/scsi/libfc/fc_rport.c:61:
drivers/scsi/libfc/fc_rport.c: In function 'fc_rport_recv_plogi_req':
include/linux/lockdep.h:347:45: error: 'rdata' may be used uninitialized in this function [-Werror=maybe-uninitialized]
#define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map)
^
drivers/scsi/libfc/fc_rport.c:1832:24: note: 'rdata' was declared here
struct fc_rport_priv *rdata;
The pointer to the lock is not initialized here, so besides the
compile-time warning, this will likely lead to an immediate
crash when dereferencing that pointer.
Fixes: ee35624e1e4e ("scsi: libfc: Add lockdep annotations")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/scsi/libfc/fc_rport.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 6aff9303251a..be640ad2b7b6 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -1835,8 +1835,6 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport,
struct fc_seq_els_data rjt_data;
u32 sid;
- lockdep_assert_held(&rdata->rp_mutex);
-
sid = fc_frame_sid(fp);
FC_RPORT_ID_DBG(lport, sid, "Received PLOGI request\n");
--
2.9.0
reply other threads:[~2018-07-11 20:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180711201617.898598-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=hare@suse.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=jth@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=satishkh@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).