drivers/scsi/lpfc/lpfc_vport.c: fix read buffer overflow
Subsystems (2)
PATCH 3/26 drivers/scsi/lpfc/lpfc_vport.c: fix read buffer overflow
From: Roel Kluin <[email protected]>
Check whether index is within bounds before testing the element.
Signed-off-by Roel Kluin <[email protected]>
Cc James Smart <[email protected]>
Cc Joe Eykholt <[email protected]>
Cc James Bottomley <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/scsi/lpfc/lpfc_vport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_vport.c renamed from drivers/scsi/lpfc/lpfc_vport.c~drivers-scsi-lpfc-lpfc_vportc-fix-read-buffer-overflow +1 -1
@@ -782,7 +782,7 @@ lpfc_destroy_vport_work_array(struct lpfint i;if (vports ==NULL )return ; -for (i =0 ; vports[i] !=NULL && i <= phba->max_vports; i++) +for (i =0 ; i <= phba->max_vports && vports[i] !=NULL ; i++)scsi_host_put (lpfc_shost_from_vport (vports[i]));kfree (vports); }
_