All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Nilesh Javali <njavali@marvell.com>,
	GR-QLogic-Storage-Upstream@marvell.com,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Himanshu Madhani <himanshu.madhani@oracle.com>,
	Pavel Machek <pavel@denx.de>,
	linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval
Date: Thu,  8 Oct 2020 19:32:39 +0100	[thread overview]
Message-ID: <20201008183239.200358-1-colin.king@canonical.com> (raw)

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

A previous change removed the initialization of rval and there is
now an error where an uninitialized rval is being returned on an
error return path. Fix this by returning -ENODEV.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: b994718760fa ("scsi: qla2xxx: Use constant when it is known")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index ae47e0eb0311..1f9005125313 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -561,7 +561,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
 	vha = fcport->vha;
 
 	if (!(fcport->nvme_flag & NVME_FLAG_REGISTERED))
-		return rval;
+		return -ENODEV;
 
 	if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
 	    (qpair && !qpair->fw_started) || fcport->deleted)
-- 
2.27.0


WARNING: multiple messages have this Message-ID (diff)
From: Colin King <colin.king@canonical.com>
To: Nilesh Javali <njavali@marvell.com>,
	GR-QLogic-Storage-Upstream@marvell.com,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Himanshu Madhani <himanshu.madhani@oracle.com>,
	Pavel Machek <pavel@denx.de>,
	linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval
Date: Thu, 08 Oct 2020 18:32:39 +0000	[thread overview]
Message-ID: <20201008183239.200358-1-colin.king@canonical.com> (raw)

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

A previous change removed the initialization of rval and there is
now an error where an uninitialized rval is being returned on an
error return path. Fix this by returning -ENODEV.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: b994718760fa ("scsi: qla2xxx: Use constant when it is known")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index ae47e0eb0311..1f9005125313 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -561,7 +561,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
 	vha = fcport->vha;
 
 	if (!(fcport->nvme_flag & NVME_FLAG_REGISTERED))
-		return rval;
+		return -ENODEV;
 
 	if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
 	    (qpair && !qpair->fw_started) || fcport->deleted)
-- 
2.27.0

             reply	other threads:[~2020-10-08 18:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 18:32 Colin King [this message]
2020-10-08 18:32 ` [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval Colin King
2020-10-08 18:40 ` Himanshu Madhani
2020-10-08 18:40   ` Himanshu Madhani
2020-10-08 18:41 ` Pavel Machek
2020-10-08 18:41   ` Pavel Machek
2020-10-08 18:58   ` Colin Ian King
2020-10-08 18:58     ` Colin Ian King
2020-10-08 20:50 ` Martin K. Petersen
2020-10-08 20:50   ` Martin K. Petersen
2020-10-13 22:42 ` Martin K. Petersen
2020-10-13 22:42   ` Martin K. Petersen

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=20201008183239.200358-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=himanshu.madhani@oracle.com \
    --cc=jejb@linux.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 \
    --cc=njavali@marvell.com \
    --cc=pavel@denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.