From: Colin Ian King <[email protected]>
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 <[email protected]>
---
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
On Thu 2020-10-08 19:32:39, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> 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 <[email protected]>
Acked-by: Pavel Machek (CIP) <[email protected]>
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
> On Oct 8, 2020, at 1:32 PM, Colin King <[email protected]> wrote:
>
> From: Colin Ian King <[email protected]>
>
> 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 <[email protected]>
> ---
> 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 <[email protected]>
--
Himanshu Madhani Oracle Linux Engineering
On 08/10/2020 19:41, Pavel Machek wrote:
> On Thu 2020-10-08 19:32:39, Colin King wrote:
>> From: Colin Ian King <[email protected]>
>>
>> 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 <[email protected]>
>
> Acked-by: Pavel Machek (CIP) <[email protected]>
>
> 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
>>
>
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
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