Skip to contentSkip to conversation

scsi: libfc: fix incorrect variable assingment

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages May 11, 2017 – May 17, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: libfc: fix incorrect variable assingment

Previous assignment was causing the use of the uninitialized variable _explan_ inside fc_seq_ls_rjt() function, which in this particular case is being called by fc_seq_els_rsp_send().

Addresses-Coverity-ID: 1398125

---
 drivers/scsi/libfc/fc_rport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libfc/fc_rport.c +1 -1
index b44c313..5203258 100644
@@ -1422,7 +1422,7 @@ static void fc_rport_recv_rtv_req(struct fc_rport_priv *rdata,
 	fp = fc_frame_alloc(lport, sizeof(*rtv));
 	if (!fp) {
 		rjt_data.reason = ELS_RJT_UNAB;
-		rjt_data.reason = ELS_EXPL_INSUF_RES;
+		rjt_data.explan = ELS_EXPL_INSUF_RES;
 		fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
 		goto drop;
 	}
Signature · 1 line
2.5.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Gustavo A. R. Silva

Previous assignment was causing the use of the uninitialized variable _explan_ inside fc_seq_ls_rjt() function, which in this particular case is being called by fc_seq_els_rsp_send().

Addresses-Coverity-ID: 1398125

---
 drivers/scsi/libfc/fc_rport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libfc/fc_rport.c +0 -0
index b44c313..5203258 100644

drivers/scsi/libfc/fc_rport.c static void fc_rport_recv_rtv_req(struct fc_rport_priv *rdata, · line 1428

Quoted 8 lines
drivers/scsi/libfc/fc_rport.c +1 -1
@@ -1422,7 +1422,7 @@ static void fc_rport_recv_rtv_req(struct fc_rport_priv *rdata,
 	fp = fc_frame_alloc(lport, sizeof(*rtv));
 	if (!fp) {
 		rjt_data.reason = ELS_RJT_UNAB;
-		rjt_data.reason = ELS_EXPL_INSUF_RES;
+		rjt_data.explan = ELS_EXPL_INSUF_RES;
 		fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
 		goto drop;
 	}

s/assingment/assignment/

#2 lore raw
In reply to Gustavo A. R. Silva

Gustavo A.,

Quoted 3 lines

Previous assignment was causing the use of the uninitialized variable _explan_ inside fc_seq_ls_rjt() function, which in this particular case is being called by fc_seq_els_rsp_send().

Applied to 4.12/scsi-fixes. Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering