From patchwork Wed Jul 11 20:15:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141771 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp709135ljj; Wed, 11 Jul 2018 13:16:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpez1pyjimV1pk+N1+jwHkY8yQnf9lX6kx2dGovjOOtH0Y+EpQSi/gp1eHPv7IQ482+CfC7M X-Received: by 2002:a17:902:704c:: with SMTP id h12-v6mr69891plt.237.1531340200923; Wed, 11 Jul 2018 13:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531340200; cv=none; d=google.com; s=arc-20160816; b=hPrKlKOuBEqXesDPOL7hKDJgRII7Yaz29oqGn7F4CzwfjNuYfpAKGP+9AjPicJEpo3 1XtnEvAc6tz0CDfUNk5KehzyGfTCxiWeyaaU2jdSBOmWamW486ZH+88vzI58htDq2HK0 EXsArFMPA8vOXV1urSl8GdxhTn6lRXUbNksvFx3PV95/1jmPUbEz9SaRusK9GVqcQhag Zdf+HIIqEIzrrmsePiJ1++PZzfZp/emWlRHOSKiodaWV8vpvmj1PQ7GgInaknPP5mLnf HT5IeSKJnGcz1JzzRd1tSw4agPGbnTE1A4wtzmQj3jbrTYCkO1eglpzirDOs6HdyxFF7 PT7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=D0vTVkqAAYJ6rVCf6GH7EUqjtWhViZ8r4FaPOoHNTB0=; b=xwTYUESvm84L3c3VKD7xdsxMkt2V4tpmxdwLvB9TtDiVtd5XxX0+daJ3zIJDdK6avo POGGGVDcprGXXyfEPlImo//5TL+Z4D9JgKTuobyzPEih/NaMXT5Mq99izZmQePCNbO7c kmBNL8A+pQx/SWog605otHOgSgBS3tXrBS7HQAsmczHHwRHFkKSJ5hi7XayeD2EJvD9z 9LRJqwha1UXds/LrfL1nF/PpYgd3WUpldtKhYJxzI+0508uijhJluzixVHNoI7ND8u8l l0jiFjVi0Pq0Bu5En2KsR2ApKaFPlsWX7TADgYRB1KPBvzal1wWuJO+TiosN8cHZl+Ji 88vQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g16-v6si822560pgk.465.2018.07.11.13.16.40; Wed, 11 Jul 2018 13:16:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390245AbeGKUWf (ORCPT + 22 others); Wed, 11 Jul 2018 16:22:35 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:42218 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732602AbeGKUWe (ORCPT ); Wed, 11 Jul 2018 16:22:34 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MdZVI-1fRCT11PX2-00PKRV; Wed, 11 Jul 2018 22:16:19 +0200 From: Arnd Bergmann To: Johannes Thumshirn , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , Hannes Reinecke , Satish Kharat , 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 Message-Id: <20180711201617.898598-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:iCPiuFXe6hCCFWf5oGJmv+09PhfD9nT3BiqkcR8HBBF9Y8f/qMP 6FQDTg8pw5oMuextRkUSTk0y2lY/3AH5NF1vRiNTxd8QuJn6yc0kwefULpSohWtllcMTo8F wrhbYvoS0BM3TWSNDlnHS9LEcEJmHdleVjkGGo4UjfhdG6eP+Ky7cg47Cb3Lx3O3AWWxtfv 1cEWzbUJYM0FAY7Y/hqXw== X-UI-Out-Filterresults: notjunk:1; V01:K0:g2aRhjjCs2o=:u1S0T5hVH9NtPEjMWxb1UG bN1VZYQtri9GbDkdXVYnI4VIoF4suzU0ayFKAM6Kau4EZLGfFftwMu1J2t0tjYupTXarvNDhG ZH/OJTSI+ymacPExewZ/dlTE/isUd7Io9NNqKW9/IRK9ZQ+s3qoTEbe4yNM5UAoSgmeE14dty snrmREZaCZ7yE1sWop/Ht3izLqeveZBiF7haoGPBTMkZp3PYYlcQsPyQoy1HYQpzl9TUJIuzs yWkTJeltRoeiTtS5uJra7t8iW7eRrPSA0zW8r9tFfju4AZgWHeb6YJuh3KC+pWPLv8MejVp+Q QnZCiPzLhe1GnJ2io2/IOIg1s5g3Q1bgMt1K5BMJI39LAmLadPthKuJ4D+5tCf4tlei9c7qY5 Bj64xezgu57ImGhK0M/Yo+yhXWToWPbouMIor+pRgcKqdt9HJZ1WMbhirNhvSGqILKk7Mr52U xeuuiBsmkkK+/vrxWfEyzfGBr2rC94FfsL9Qez+hYEKQaklyUuSrD2pZD1JciQC8eDFBTJQwh QvILunxxmsO3uki35okkXHFvxdSKsMEfoc0jNPImzSVSPlZgY6YqEbqwECOgtzJcU5SXLoDtW Q5gRFbtYGQm5Y4VXJYaYuSgBV7xEltVVS1QtlZ4hkDrhco4qu1Pw9v8HSe8JExKG6iXGFGVS+ v9qvQ8vFzCGrwcgVkWLpMsf1mFURyGAITo9nM7cizNXsWdvRv9XqJG+az4alXTi5w4yE= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/scsi/libfc/fc_rport.c | 2 -- 1 file changed, 2 deletions(-) -- 2.9.0 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");