Skip to content

Commit e11e285

Browse files
Dan Carpentermartinkpetersen
authored andcommitted
scsi: qla2xxx: edif: Fix off by one bug in qla_edif_app_getfcinfo()
The > comparison needs to be >= to prevent accessing one element beyond the end of the app_reply->ports[] array. Link: https://lore.kernel.org/r/20211109115219.GE16587@kili Fixes: 7878f22 ("scsi: qla2xxx: edif: Add getfcinfo and statistic bsgs") Reviewed-by: Ewan D. Milne <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 73185a1 commit e11e285

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/qla2xxx/qla_edif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
865865
"APP request entry - portid=%06x.\n", tdid.b24);
866866

867867
/* Ran out of space */
868-
if (pcnt > app_req.num_ports)
868+
if (pcnt >= app_req.num_ports)
869869
break;
870870

871871
if (tdid.b24 != 0 && tdid.b24 != fcport->d_id.b24)

0 commit comments

Comments
 (0)