Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbcDRFvx (ORCPT ); Mon, 18 Apr 2016 01:51:53 -0400 Received: from mail-bn1bon0141.outbound.protection.outlook.com ([157.56.111.141]:28224 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751804AbcDRFvu convert rfc822-to-8bit (ORCPT ); Mon, 18 Apr 2016 01:51:50 -0400 X-Greylist: delayed 2043 seconds by postgrey-1.27 at vger.kernel.org; Mon, 18 Apr 2016 01:51:50 EDT From: Nilesh Javali To: Dan Carpenter , Dept-Eng QLogic Storage Upstream CC: "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi , linux-kernel , "kernel-janitors@vger.kernel.org" Subject: Re: [patch] bnx2i: silence uninitialized variable warnings Thread-Topic: [patch] bnx2i: silence uninitialized variable warnings Thread-Index: AQHRljGrRfWnGRPdjE6Zwb4MhHLQgp+PkwwA Date: Mon, 18 Apr 2016 05:17:39 +0000 Message-ID: References: <20160414094006.GB16891@mwanda> In-Reply-To: <20160414094006.GB16891@mwanda> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.6.1.160122 authentication-results: oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=none action=none header.from=qlogic.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [114.143.185.87] x-ld-processed: 0d68a1f9-1490-4d0e-8767-a87dab3ef2ba,ExtAddr,ExtAddr x-ms-office365-filtering-correlation-id: 06267ac6-2b9b-44df-6eef-08d36748c376 x-microsoft-exchange-diagnostics: 1;CO2PR11MB0055;5:xEHvI/gR+MWnwWfi+nPtSqfK/xnAUZRqEc4yy6b4QApBvLa6D4r3tJCT2LIV4aGqVJL6aE6kgj7WNjQbqLtWyE+uyKsn/27pTpNQ+Po3JhE3NOddWWhG3lXVUYFbnJK9KF+NYPi+zEamy3sNmegwfw/MIGgz1UffXIyV8iTSoPImyaaXyXym0kIs/ai9g5lu;24:w4Ycp1oKtao4CATOvGcq50DHmchCrr31dgvh0f5ee0k7niGgcplw9Ylo4zg/f1jfcGFKKDJ6ktg0+HSJVLRIxpfO13KXkp2PPcSqHb7x+m4=;7:miilHUu4XqPYWnAWSLBL11Fu/c/ZX1uaybYgXxsAU/OdPYO//vmPpJWtj4HyNfQ34uRO2NYM87ZiN+lWP/9io4GXcbithSgxZ2/8j1FLt1xEyNhBycVnpi/2gFachzzxu0pRhWFQdKmL9s1mUThWWmXSybu7UQOy1GvpCSlBlW2RHiszB4WOG4hwj687dVIZTc0DFHHnzceTDfq/zAdBLzPa/ToYE4MEUnI5midbgXY=;20:e0TXwTG53vllSM+GIWGB66xBQfGY4nJ3IEabIfV6IWq+5VUDQlwJlgdnhiY3bSGoWI+QYz7w9nGbGgngzbhKkAWzKKkSZalnAWFASkWk2H6jvlinj5I8lHg0n9smHi2dZT/bzkpB77mBlPLgjSAv52e1fVgXl3UK3lEHz/skhRE= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR11MB0055; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:CO2PR11MB0055;BCL:0;PCL:0;RULEID:;SRVR:CO2PR11MB0055; x-forefront-prvs: 0916FC3A18 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(24454002)(2900100001)(54356999)(5008740100001)(19580395003)(83506001)(5004730100002)(87936001)(19580405001)(92566002)(50986999)(76176999)(11100500001)(86362001)(122556002)(2950100001)(77096005)(102836003)(36756003)(6116002)(5002640100001)(586003)(99286002)(81166005)(66066001)(3660700001)(1220700001)(189998001)(4326007)(3846002)(106116001)(10400500002)(5001770100001)(3280700002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO2PR11MB0055;H:CO2PR11MB0054.namprd11.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <140125C14B5A5146A0C745E8FF9CCA8B@namprd11.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: qlogic.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2016 05:17:39.2277 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0d68a1f9-1490-4d0e-8767-a87dab3ef2ba X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR11MB0055 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1148 Lines: 37 On 14/04/16 3:10 PM, "Dan Carpenter" wrote: >Presumably it isn't possible to have empty lists here, but my static >checker doesn't know that and complains that "ep" can be used >uninitialized. > >Signed-off-by: Dan Carpenter > >diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c >b/drivers/scsi/bnx2i/bnx2i_iscsi.c >index 7289437..133901f 100644 >--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c >+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c >@@ -675,7 +675,7 @@ bnx2i_find_ep_in_ofld_list(struct bnx2i_hba *hba, u32 >iscsi_cid) > { > struct list_head *list; > struct list_head *tmp; >- struct bnx2i_endpoint *ep; >+ struct bnx2i_endpoint *ep = NULL; > > read_lock_bh(&hba->ep_rdwr_lock); > list_for_each_safe(list, tmp, &hba->ep_ofld_list) { >@@ -703,7 +703,7 @@ bnx2i_find_ep_in_destroy_list(struct bnx2i_hba *hba, >u32 iscsi_cid) > { > struct list_head *list; > struct list_head *tmp; >- struct bnx2i_endpoint *ep; >+ struct bnx2i_endpoint *ep = NULL; > > read_lock_bh(&hba->ep_rdwr_lock); > list_for_each_safe(list, tmp, &hba->ep_destroy_list) { Acked-by: Nilesh Javali