From patchwork Wed Feb 14 16:23:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10219405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 46605601C2 for ; Wed, 14 Feb 2018 16:24:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39FC3283ED for ; Wed, 14 Feb 2018 16:24:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EDB428AAA; Wed, 14 Feb 2018 16:24:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, TVD_SUBJ_WIPE_DEBT autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B1AF283ED for ; Wed, 14 Feb 2018 16:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032505AbeBNQXq (ORCPT ); Wed, 14 Feb 2018 11:23:46 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:41907 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032204AbeBNQXo (ORCPT ); Wed, 14 Feb 2018 11:23:44 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1elzqP-0001EL-HX; Wed, 14 Feb 2018 16:23:41 +0000 From: Colin King To: Hannes Reinecke , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][scsi-next] scsi: myrb: remove shadowed and unassigned variable ldev_num Date: Wed, 14 Feb 2018 16:23:41 +0000 Message-Id: <20180214162341.335-1-colin.king@canonical.com> X-Mailer: git-send-email 2.15.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King A lower-scoped variable ldev_num is never assigned and is shadowing the higher scoped iterator ldev_num and should be removed to avoid using garbage ldev_num values. Detected by CoverityScan, CID#1465226 ("Uninitialized scalar variable") Fixes: dd47c1072226 ("scsi: myrb: Add Mylex RAID controller (block interface)") Signed-off-by: Colin Ian King --- drivers/scsi/myrb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c index 973a2250208f..65ade4d37b33 100644 --- a/drivers/scsi/myrb.c +++ b/drivers/scsi/myrb.c @@ -422,7 +422,6 @@ static unsigned short myrb_get_ldev_info(myrb_hba *cb) myrb_ldev_info *old = NULL; myrb_ldev_info *new = cb->ldev_info_buf[ldev_num]; struct scsi_device *sdev; - unsigned short ldev_num; myrb_devstate old_state = DAC960_V1_Device_Offline; sdev = scsi_device_lookup(shost, myrb_logical_channel(shost),