linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval
@ 2020-10-08 18:32 Colin King
  2020-10-08 18:40 ` Himanshu Madhani
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Colin King @ 2020-10-08 18:32 UTC (permalink / raw)
  To: Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, Himanshu Madhani,
	Pavel Machek, linux-scsi
  Cc: kernel-janitors, linux-kernel

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval
  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:41 ` Pavel Machek
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Himanshu Madhani @ 2020-10-08 18:40 UTC (permalink / raw)
  To: Colin King
  Cc: Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, Pavel Machek,
	linux-scsi, kernel-janitors, linux-kernel



> On Oct 8, 2020, at 1:32 PM, Colin King <colin.king@canonical.com> wrote:
> 
> 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
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval
  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:41 ` Pavel Machek
  2020-10-08 18:58   ` Colin Ian King
  2020-10-08 20:50 ` Martin K. Petersen
  2020-10-13 22:42 ` Martin K. Petersen
  3 siblings, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2020-10-08 18:41 UTC (permalink / raw)
  To: Colin King
  Cc: Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, Himanshu Madhani,
	Pavel Machek, linux-scsi, kernel-janitors, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]

On Thu 2020-10-08 19:32:39, Colin King wrote:
> 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>

Acked-by: Pavel Machek (CIP) <pavel@denx.de>

And sorry, I did patch against mainline, and this got added in -next
in the meantime.

> 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
> 

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval
  2020-10-08 18:41 ` Pavel Machek
@ 2020-10-08 18:58   ` Colin Ian King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin Ian King @ 2020-10-08 18:58 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, Himanshu Madhani,
	linux-scsi, kernel-janitors, linux-kernel

On 08/10/2020 19:41, Pavel Machek wrote:
> On Thu 2020-10-08 19:32:39, Colin King wrote:
>> 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>
> 
> Acked-by: Pavel Machek (CIP) <pavel@denx.de>
> 
> And sorry, I did patch against mainline, and this got added in -next
> in the meantime.

Ah, that explains it. No problem, Coverity is good at finding buglets

Colin

> 
>> 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
>>
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval
  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:41 ` Pavel Machek
@ 2020-10-08 20:50 ` Martin K. Petersen
  2020-10-13 22:42 ` Martin K. Petersen
  3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-10-08 20:50 UTC (permalink / raw)
  To: Colin King
  Cc: Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, Himanshu Madhani,
	Pavel Machek, linux-scsi, kernel-janitors, linux-kernel


Colin,

> 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.

Applied to 5.10/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval
  2020-10-08 18:32 [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval Colin King
                   ` (2 preceding siblings ...)
  2020-10-08 20:50 ` Martin K. Petersen
@ 2020-10-13 22:42 ` Martin K. Petersen
  3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-10-13 22:42 UTC (permalink / raw)
  To: Nilesh Javali, Colin King, Pavel Machek, James E . J . Bottomley,
	linux-scsi, Himanshu Madhani, GR-QLogic-Storage-Upstream
  Cc: Martin K . Petersen, linux-kernel, kernel-janitors

On Thu, 8 Oct 2020 19:32:39 +0100, Colin King wrote:

> 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.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: qla2xxx: Fix return of uninitialized value in rval
      https://git.kernel.org/mkp/scsi/c/1ef16a407f54

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-13 22:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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:41 ` Pavel Machek
2020-10-08 18:58   ` Colin Ian King
2020-10-08 20:50 ` Martin K. Petersen
2020-10-13 22:42 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).