scsi: qla2xxx: fix return of uninitialized value in rval
Subsystems (3)
PATCH 1/1 scsi: qla2xxx: fix return of uninitialized value in rval
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")
--- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_nvme.c +1 -1
@@ -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)
Signature · 1 line
2.27.0
Quoted 33 lines · Colin King
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(-)drivers/scsi/qla2xxx/qla_nvme.c +1
-1@@ -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)Signature · 1 line
2.27.0
--
Himanshu Madhani Oracle Linux Engineering
Quoted 9 lines · Colin King
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]>
And sorry, I did patch against mainline, and this got added in -next in the meantime.
Quoted 15 lines
index
ae47e0eb0311..1f9005125313100644drivers/scsi/qla2xxx/qla_nvme.c +1
-1@@ -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)Signature · 1 line
2.27.0
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 7 lines · Pavel Machek
Quoted 6 lines · Colin King
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.
Quoted 8 lines
Quoted 3 lines
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes b994718760fa ("scsi: qla2xxx: Use constant when it is known")Signed-off-by Colin Ian King <[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
Quoted 17 lines
Quoted 16 lines
index
ae47e0eb0311..1f9005125313100644drivers/scsi/qla2xxx/qla_nvme.c +1
-1@@ -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)Signature · 1 line
2.27.0
Martin K. Petersen
AppliedColin,
Quoted 3 lines
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!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 3 lines · Colin King
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
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering