scsi: fnic: Fix use of uninitialized value in debug message
Subsystems (2)
PATCH 1/1 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 f828af44b8dd ("scsi: fnic: Add support for unsolicited requests and responses")
Signed-off-by Dheeraj Reddy Jonnalagadda <[email protected]>
--- drivers/scsi/fnic/fdls_disc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/fnic/fdls_disc.c +1 -2
@@ -3904,7 +3904,7 @@ fdls_process_abts_req(struct fnic_iport_s *iport, struct fc_frame_header *fchdr)uint8_t *frame;struct fc_std_abts_ba_acc *pba_acc;uint32_t nport_id; -uint16_t oxid; +uint16_t oxid =FNIC_STD_GET_OX_ID (fchdr);struct fnic_tport_s *tport;struct fnic *fnic = iport->fnic; uint16_t frame_size = FNIC_ETH_FCOE_HDRS_OFFSET +
@@ -3916,7 +3916,6 @@ fdls_process_abts_req(struct fnic_iport_s *iport, struct fc_frame_header *fchdr) tport =fnic_find_tport_by_fcid (iport, nport_id);if (tport) { - oxid =FNIC_STD_GET_OX_ID (fchdr);if (tport->active_oxid == oxid) { tport->flags |=FNIC_FDLS_TGT_ABORT_ISSUED ;fdls_free_oxid (iport, oxid, &tport->active_oxid);
Signature · 1 line
2.34.1
Quoted 36 lines · Dheeraj Reddy Jonnalagadda
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 usingFNIC_STD_GET_OX_ID(fchdr).Fixes f828af44b8dd ("scsi: fnic: Add support for unsolicited requests and responses")Signed-off-by Dheeraj Reddy Jonnalagadda <[email protected]>--- drivers/scsi/fnic/fdls_disc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)diff --git a/drivers/scsi/fnic/fdls_disc.c b/drivers/scsi/fnic/fdls_disc.c index 2534af2fff53..266d9f090772 100644 --- a/drivers/scsi/fnic/fdls_disc.c +++ b/drivers/scsi/fnic/fdls_disc.c @@ -3904,7 +3904,7 @@ fdls_process_abts_req(struct fnic_iport_s *iport, struct fc_frame_header *fchdr) uint8_t *frame; struct fc_std_abts_ba_acc *pba_acc; uint32_t nport_id;drivers/scsi/fnic/fdls_disc.c +1
-3-uint16_t oxid; +uint16_t oxid =FNIC_STD_GET_OX_ID (fchdr);struct fnic_tport_s *tport;struct fnic *fnic = iport->fnic; uint16_t frame_size = FNIC_ETH_FCOE_HDRS_OFFSET +@@ -3916,7 +3916,6 @@ fdls_process_abts_req(struct fnic_iport_s *iport, struct fc_frame_header *fchdr) tport =fnic_find_tport_by_fcid (iport, nport_id);if (tport) { - oxid =FNIC_STD_GET_OX_ID (fchdr);if (tport->active_oxid == oxid) { tport->flags |=FNIC_FDLS_TGT_ABORT_ISSUED ;fdls_free_oxid (iport, oxid, &tport->active_oxid); --
Quoted 3 lines
2.34.1
Thanks for your change. The change looks good.
Reviewed-by Karan Tilak Kumar <[email protected]>
Regards,
Karan