Skip to content

Commit 8ccc594

Browse files
Dheeraj Reddy Jonnalagaddamartinkpetersen
authored andcommitted
scsi: fnic: Fix use of uninitialized value in debug message
The oxid variable in fdls_process_abts_req() was only being initialized inside the if (tport) block, but was being used in a debug print statement after that block. If tport was NULL, oxid would remain uninitialized. Move the oxid initialization to happen at declaration using FNIC_STD_GET_OX_ID(fchdr). Fixes: f828af4 ("scsi: fnic: Add support for unsolicited requests and responses") Closes: https://scan7.scan.coverity.com/#/project-view/52337/11354?selectedIssue=1602772 Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com> Link: https://lore.kernel.org/r/20250108050916.52721-1-dheeraj.linuxdev@gmail.com Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 17789f8 commit 8ccc594

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/scsi/fnic/fdls_disc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,7 +3900,7 @@ fdls_process_abts_req(struct fnic_iport_s *iport, struct fc_frame_header *fchdr)
39003900
uint8_t *frame;
39013901
struct fc_std_abts_ba_acc *pba_acc;
39023902
uint32_t nport_id;
3903-
uint16_t oxid;
3903+
uint16_t oxid = FNIC_STD_GET_OX_ID(fchdr);
39043904
struct fnic_tport_s *tport;
39053905
struct fnic *fnic = iport->fnic;
39063906
uint16_t frame_size = FNIC_ETH_FCOE_HDRS_OFFSET +
@@ -3912,7 +3912,6 @@ fdls_process_abts_req(struct fnic_iport_s *iport, struct fc_frame_header *fchdr)
39123912

39133913
tport = fnic_find_tport_by_fcid(iport, nport_id);
39143914
if (tport) {
3915-
oxid = FNIC_STD_GET_OX_ID(fchdr);
39163915
if (tport->active_oxid == oxid) {
39173916
tport->flags |= FNIC_FDLS_TGT_ABORT_ISSUED;
39183917
fdls_free_oxid(iport, oxid, &tport->active_oxid);

0 commit comments

Comments
 (0)