mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Hannes Reinecke <hare@suse.de>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	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	[thread overview]
Message-ID: <20180214162341.335-1-colin.king@canonical.com> (raw)

From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 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),
-- 
2.15.1

                 reply	other threads:[~2018-02-14 16:23 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=20180214162341.335-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=hare@suse.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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

all inboxes | Powered by JetHome®